Click to See Complete Forum and Search --> : Default form field value


jwgrafflin
06-04-2008, 04:25 AM
Is it possible to set a default value for a form field?

Shanu.chaudhary
06-04-2008, 04:44 AM
yes.but for which field? text box or combo?
Anyhow i think for anything u can set a default value.

jwgrafflin
06-04-2008, 04:49 AM
Then don't keep me in suspense any longer. Please tell me (or show me) how.

I wish to have my referral ID already filled in so they don't forget.

I can get it to work using:
<select><option value="jwgmg" selected>JWGMG</option></select>
My ID appears in the field, but with the down arrow, which I do not want.

Shanu.chaudhary
06-04-2008, 05:27 AM
you are setting the option value to this "jwgmg".

but with the down arrow, which I do not want.

What this mean?

jwgrafflin
06-04-2008, 05:33 AM
I appreciate you trying to help, but I'll wait for someone who is a little more familiar with forms to step in.

ncaatrackstar
06-04-2008, 02:19 PM
Default value will be: Micky Mouse


Text Field
<input type="text" name="person" value="Mickey Mouse" />

Hidden Field
<input type="hidden" name="person" value="Mickey Mouse" />

Text Area
<textarea name="person">Mickey Mouse</textarea>

Select Menu
<select name="person">
<option name="Donald Duck">Donald Duck</option>
<option name="Mickey Mouse" selected="selected">Mickey Mouse</option>
<option name="Snoopy">Snoopy</option>
</select>

Radio Button
<input type="radio" name="person" value="Donald Duck">
<input type="radio" name="person" checked="checked" value="Mickey Mouse">
<input type="radio" name="person" value="Snoopy">

<input type="checkbox" name="person" value="Donald Duck">
<input type="checkbox" name="person" checked="checked" value="Mickey Mouse">
<input type="checkbox" name="person" value="Snoopy">

jwgrafflin
06-05-2008, 01:05 AM
Excellent. Here's the final code.


<tr>
<td>Referral ID:</td>
<td><input size="10" type="text" name="person" value="JWGMG"
style="background-color: #ffff00; text-align: center; font-weight: bold;
border: #6495ed 1px solid; margin-left: 1em"/></td>
</tr>


To see it on the page - http://www.tax-savings-depot.com/order.html

Thanks!