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

mail checkbox info

Status
Not open for further replies.

d0s

Programmer
Apr 15, 2004
48
US
im creating a form that will have checkboxes. The email works good, but how would i set a variable with a checkbox and put it in the mail process to be mailed to me. also, if using the onclick to set a variable how can i unset the variable if they deselect it? thanks
 
in the onclick event, check to see if the box is on or off

Bastien

Cat, the other other white meat
 
Don't confuse client side and server side.
A checkbox in a HTML form (without any event handlers) passes it's value attribute to the receiving script when it is checked at the time of submission. You can click it on or off as often as you like. No variable is "set".
Checkboxes operate as toggles - when the toggle is on the value attribute is passed. When the toggle is off nothing, not even the checkbox name, is present.

Client side you can do all kinds of things using scripting - hwoever, it might be unreliable. I'd rather rely on the basic HTML form elements and the way they work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top