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

check boxes

Status
Not open for further replies.

danalynn

Programmer
Jun 12, 2001
25
0
0
US
i am making a page where i need to have a box that people can check. i don't know how to do this. if anyone can helpme that would be wonderful and greatly appreciated. the box needs to have a true value if checked and a false value if unchecked.

thanks again

dana
 
danalynn,

Do you mean this?
<input type=checkbox name=box value=&quot;Yes&quot; checked>Yes

The 'checked' attribute shows the box is checked. You should put it in a form, and process the form using javascript, vbscript, perl or any other scripting language on the page. You would need opening/closing form tags with the name of the form too. For inpage javascript, don't worry about the action and method attributes of the form tag. But make sure that your button calls the function onclick...ex. onclick=&quot;check_checkox&quot;. If you just want it for looks, do the line above. Hope this helps.

A javascript quick check would be like this:
<script language=javascript>
function check_checkbox(){
if(document.formname.box.checked=true){
alert(&quot;You checked this box&quot;);
}
}
</script>

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top