Click to See Complete Forum and Search --> : Checkbox returning null value


webwarrior925
08-22-2007, 07:48 AM
Ok I am working on updating this form and I can't get the the new check box to return a yes or no value. I already have one check box that works, but it always returns a yes value based on validation. The current check box does not need to be validated, but just return a yes or no value based on being checked or not.

Here are some parts of the code I am using



Dim blnSendMseg 'As Boolean

blnSendMseg = CBool(UCase(Trim(Request("chkSendMseg"))) = "TRUE")

" [SendMseg] " & _

" '" & IIf(blnSendMseg, "Yes", "No") & "', " & _

<input type="checkbox" name="chkSendMseg" id="chkSendMseg" value="TRUE"<% If blnSendMseg = True Then Response.Write " checked" %> /><label for="chkSendMseg" class="style7"> Would you like to receive special offers via Text Message? (NOTE:Rates may apply check with your local carrier)</label><br /><br />



I am using an SQL database and its set to varchar (3) as the datatype.
If there is any other info you need just ask. Thanks everyone!

webwarrior925
08-23-2007, 07:38 AM
Anyone go any ideas? I feel like my code is right, but something with the database is going wrong. The other checkbox works fine. I even tried just putting a variable in the SendMseg field and still got a Null Value. I am using SQL Sever.

Terrorke
08-27-2007, 02:24 AM
How do you retrieve the value of the checkbox?

webwarrior925
08-27-2007, 07:08 AM
Hey I got it. The form was actually calling another page in the action tag. I didn't notice it at first.

Terrorke
08-27-2007, 10:30 AM
That can happen :)