checkbox

Discussion in 'ASP General' started by Paul, Jul 18, 2003.

  1. Paul

    Paul Guest

    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.
     
    Paul, Jul 18, 2003
    #1
    1. Advertising

  2. Paul

    MDB Guest

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

    The checkbox is a string not a boolean value.




    "Paul" <> wrote in message
    news:%...
    > 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, Jul 18, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad
    Replies:
    0
    Views:
    529
    tshad
    Apr 15, 2005
  2. Vikram

    disable checkbox list checkbox

    Vikram, Jan 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,404
    ThunderMusic
    Jan 25, 2006
  3. =?Utf-8?B?RG90TmV0RGV2?=

    DataGrid and embeded Checkbox..How to find if checkbox clicked

    =?Utf-8?B?RG90TmV0RGV2?=, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    829
    David Wier
    Oct 6, 2006
  4. Jason Huang
    Replies:
    0
    Views:
    558
    Jason Huang
    Jun 29, 2007
  5. Joey Pang
    Replies:
    4
    Views:
    523
    Joey Pang
    Jun 13, 2005
Loading...

Share This Page