Forum Moderators: open

Message Too Old, No Replies

check box problem

Is is possible to send a value when a check box has not been ticked?

         

dawlish

4:01 pm on Apr 5, 2002 (gmt 0)

10+ Year Member



Is is possible to send a value when a check box has not been ticked? The default is an empty value.

Essentially I have created a html form that includes some check boxes. I want a value of "N" to be sent when a form is submitted if a check box is not ticked and "Y" if it is checked.

Thanks in advance for any help or suggestions.

TvED

4:17 pm on Apr 5, 2002 (gmt 0)

10+ Year Member



Would a radio button not serve the purpose?

txbakers

5:05 pm on Apr 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could do it with a hidden field and javascript.

Have the javascript read the checkbox before the form is submitted. If box.checked then hiddendfield.value = "Y" else hiddenfield.value = "N"

You would submit the hidden field to the DB instead of the checkbox.