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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkbox Value

Status
Not open for further replies.

Fris

Programmer
Jun 23, 2003
22
US
I need to have a checkbox appear on a form already checked. I have the following code:


<tr>
<td>Air Monitoring</td>
<td><input type="checkbox" name="fld22" value="true"></td></tr>

Obviously the code is lacking something...what do I need to add in order for the box to appear checked? I've tried value="checked" value="yes" value="-1"

Thank you for your time.

 
<input type="checkbox" name="fld22" checked>

This is most likely an HTML question :)

*cLFlaVA
----------------------------
A polar bear walks into a bar and says, "Can I have a ... beer?"
The bartender asks, "What's with the big pause?
 
Actually, you'll still want to include the value attribute, just in addition to the checked property.

<input type="checkbox" name="fld22" value="true" checked>

*cLFlaVA
----------------------------
A polar bear walks into a bar and says, "Can I have a ... beer?"
The bartender asks, "What's with the big pause?
 
Thank you ever-so, cLFlaVa! That one word - "checked" - is all I needed. My apologies for posting in the wrong forum. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top