focus on textbox when using php array inputs

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

focus on textbox when using php array inputs

Post by josh »

Both of these give eratic behaviour in firefox 1.0.7, works fine in IE. Anyone else that has the old version could you test it out?

Specifically it lets me type in the first box, but when I click in the second box the focus jumps back to the first box. If anyone can explain this behaviour that'd be great. I know I can just number the names phone1, phone2 and do that instead of an array, just wondering why this isn't working because I thought it's supposed to.

Code: Select all

<input name="phone[]" type="text" id="phone1" value="" size="3" maxlength="3" />
			<input name="phone[]" type="text" id="phone2" value="" size="3" maxlength="3" />
			<input name="phone[]" type="text" id="phone3" value="" size="4" maxlength="4" />
and I also tried

Code: Select all

<input name="phone[]" type="text" id="phone[]" value="" size="3" maxlength="3" />
			<input name="phone[]" type="text" id="phone[]" value="" size="3" maxlength="3" />
			<input name="phone[]" type="text" id="phone[]" value="" size="4" maxlength="4" />
EDIT: I'm sure I just violated standard or something but if someone could point it out..
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

my guess is it's in your javascript? that should work. it's just standard HTML :P
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

no jscript on the page
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to Client-Side.
Post Reply