Hi Melinda,
Basically the way checkboxes work is that they have a value, and if the box
is checked, this value is submitted with the form. If its not checked, then
a "" is submitted instead. You can get the value to be 1 instead of "on" by
changing the value in the checkbox tag:
<INPUT Type="checkbox" VALUE="1">
but you'll need to either insert zeros on the server after the form is
submitted or modify your stored proc to accept blanks instead
-----Original Message-----
From: Melinda Savoy [mailto:msavoy@h...]
Sent: 04 January 2002 16:39
To: javascript
Subject: [javascript] PLEASE HELP!! - Changing the value of a checkbox
My question revolves around the value of a set of checkboxes on my form.
I have a form that contains a checkbox for each day of the week and the
office hours pertient to that row of checkboxes checked.
The stored procedure is set to receive a string consisting of a comma
delimited value as follows (1,1,1,1,1,0,0,09:00am,5:00pm).
I am trying to convert the value of the checkbox to a "1" or a "0"
depending on if the box is checked or not and then concatinate the
REQUEST.FORM for each NAME value of that checkbox. The value of that
checkbox is either ON or OFF initially and then when I submit the form I
want to pass the "1" or "0" value.
When I response write out the variable containing the concatinated value
I am getting (on,on,on,on,on,,,09:00am,05:00pm).
Will someone please tell me what I am doing wrong? This is driving me
nuts.
Thank you.
________________________________________________________________________
Scottish Enterprise Network
http://www.scottish-enterprise.com
Headquarters Address & Contact Numbers
150 Broomielaw
5 Atlantic Quay
Glasgow
G2 8LU.
Tel: +44 (0) 141 248 2700.
Fax: +44 (0)141 221 3217
This message is sent in confidence for the addressee only.
It may contain legally privileged information. The contents are not to
be disclosed to anyone other than the addressee. Unauthorised recipients
are requested to preserve this confidentiality and to advise the sender
immediately of any error in transmission.