again! hello Mark

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gudipati
    New Member
    • Oct 2007
    • 21

    again! hello Mark

    hi,

    i have tried what u said.but still i have the same prm.can u guess what i missed.
    if request.form("c urrent") = "on" then
    current = -1
    else
    current = 0
    end if

    in desing view i have set default value=0 format=on/off.pl give exact prm with my code.

    <input name="current" type="checkbox" id="current" >

    pl give reply as soon as possible.
    thank u Mark
  • markrawlingson
    Recognized Expert Contributor
    • Aug 2007
    • 346

    #2
    Hello gudipati,

    If you are still having problems with it, the best thing I can suggest is to see what the value of the checkbox actually is.

    'at the top of your page
    [code=asp]
    Response.Write "This is the value of the checkbox: " & Request.Form("C urrent")
    [/CODE]

    and see what it spits out.

    Secondly, after your if..else statement where you are setting the value of the variable "Current" which you then place into your SQL string - write out it's value.

    [CODE=ASP]
    If Request.form("c urrent") = "on" Then
    Current = -1
    else
    Current = 0
    end if
    Response.Write "The value of the 'Current' variable is: " & Current
    [/CODE]

    Also keep in mind that if the checkbox is NOT checked.. it will NOT return a value to your code, so at the very least this could should render NO into your database unless there is a problem with the SQL insert statement

    If you ARE getting an error, post it and I'll take a closer look

    Sincerely,
    Mark

    Comment

    Working...