Page 1 of 1

focus on textbox when using php array inputs

Posted: Wed Nov 09, 2005 1:59 pm
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..

Posted: Wed Nov 09, 2005 2:13 pm
by s.dot
my guess is it's in your javascript? that should work. it's just standard HTML :P

Posted: Wed Nov 09, 2005 4:01 pm
by josh
no jscript on the page

Posted: Wed Nov 09, 2005 4:13 pm
by John Cartwright
Moved to Client-Side.