[thelist] PHP/html form queston: a better way to do this form and submission?

Bruce Gilbert webguync at gmail.com
Thu Aug 11 10:48:57 CDT 2005


I am working on a form which uses PHP to submit the info. to an email
address. For an instance like a phone number I  have the html mark-up
like this:

<td colspan="2"><label for="home_phone_number">Home Phone
Number:</label><br> <input
                        class="textbox" maxlength="6" size="6"
name="area_code" id="area_code" value="{$_POST['area_code']}"> &nbsp;
                        class="textbox" maxlength="6" size="6"
name="3_digit_exchange" id="3_digit_exchange"
value="{$_POST[3_digit_exchange]}" > &nbsp;
                        class="textbox" maxlength="10" size="10"
name="last_four_digits" id="last_four_digits"
value="{$_POST['last_4_digits']}"> &nbsp;

with different input values for the area code, 3 digit exchange and
last 4 digits. and then you check the values of each and post either
the results or an error.

Posting 'You didn't enter your " .$fieldname " might be confusing if
the fieldname is "last_four_digits" so, I was hoping of a more
simplified way to do this type of information in my form.

Also is there a way for the form to automatically go to the next field
once a certain amount of info. has been entered? eg: after putting in
3 digits for the area code, the cursor will automatically jump to the
next field?



More information about the thelist mailing list