Connecting Tech Pros Worldwide Forums | Help | Site Map

checkbox

Paul
Guest
 
Posts: n/a
#1: Jul 19 '05
I know this is gonna sound silly but when I submit a form with a checkbox
html control "mychk", how can I see if that is checked or not ?

I have tried :

if request.form("mychk") = true then
' code
else
' code
end if

But it always executes the code in the else statement meaning it is never
true despite the fact I have given the checkbox a value of true.





MDB
Guest
 
Posts: n/a
#2: Jul 19 '05

re: checkbox


Try if request.form("mychk") = "true" then

The checkbox is a string not a boolean value.




"Paul" <paul@themedialounge.com> wrote in message
news:%23FK6fURTDHA.2148@TK2MSFTNGP11.phx.gbl...[color=blue]
> I know this is gonna sound silly but when I submit a form with a checkbox
> html control "mychk", how can I see if that is checked or not ?
>
> I have tried :
>
> if request.form("mychk") = true then
> ' code
> else
> ' code
> end if
>
> But it always executes the code in the else statement meaning it is never
> true despite the fact I have given the checkbox a value of true.
>
>
>
>[/color]


Closed Thread


Similar ASP / Active Server Pages bytes