Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with tables... 3

Status
Not open for further replies.

noslenwerd

Programmer
May 2, 2005
59
US


Two questions... under the first section 'company information', how can i get the asterix to be right before 'state' and 'Zipcode', they keep appearing above the words?

Also, under Contact information, Phone:... how can i get all 3 input boxes to be on the same line? also how can i get it so that when someone is done typing in the area code.. it just moves to the next box for the rest of the 7 numbers...

Thanks !

(obviously just right click, view source to see the code)
 
1. Try "* State:" instead of "* State:". Should work for Zip too.

2. The phone number wrapping is a function of the browser width. If I make the browser window wide enough, the phone number is all on one line. I was able to get the phone number to not wrap permanently by specifying "nowrap" in the <TD>, but of course, that's a deprecated specification.


Mike Krausnick
Dublin, California
 
Your table that holds the controls is not big enough to accomodate all the fields. Do the following:

1. Add border to the table -- this will help you see where cells are too small to accomodate text
2. Enlarge the cells that have trouble holding text -- the phone number one is easy to solve, just add [tt]colspan[/tt].
3. Remove border to get back to invisible table mode.

Hope it helps.
 
great thanks guys... is there anyway to do the last part that i asked?

About it automatically tabbing over to the next field while putting the phone numbers in?

Thanks a bunch guys
 

That would require JavaScript (more help on this available in forum216).

You would need to use the onkeyup or onkeypress events to check the length of the value, and if it was 3 (or however many the area code is), then set focus on the next field.

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Thanks guys! this forum is awesome...

Most forums i need to wait all day to get a response
 
<td align="right" nowrap>&nbsp;* Phone:&nbsp;&nbsp;</td>
<td><input type="hidden" name="Contact_Phone_1"><input type="text" size="3" name="_Phone11" maxlength="3"> - <input type="text" size="3" name="_Phone12" maxlength="3"> - <input type="text" size="3" name="_Phone13" maxlength="4"></td>


This is what i have so far for the phone table. Any idea why the nowrap isn't taking any effect?

Thanks
 
noslenwerd (Drew?),

FYI, on your existing site:


The "<a name="top">" is never closed, which leads to the whole contents of the page being treated as an anchor. It looks very weird in FF when you roll over the text on that page (and in fact, every page that has that same issue).

Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]
 
You're issuing [tt]nowrap[/tt] on the first column (which is not wrapped), not on the second. Did you give your table borders to see what's causing all the problems? If you give it borders, you will see that the cell holding the phone number field is much smaller than what you may think. I think you should make the second cell (holding the input fields) span over more than one column with the [tt]colspan[/tt] attribute.
 
yup the names Drew :)

Yea thanks i actually noticed that when i first started this job about 3 weeks ago. The kid before me wrote some pretty shoddy scripts. Problem is its like this for EVERY one of our 25 sites... so i have some tedious work to do... haha
 
Vragabond

Yes I did look at it with borders, and in an editor they all show up on the same line which is weird.

But i set colspan = 5 and it fixed the problem

Thanks a bunch guys!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top