PLEASE HELP!! Problem with getting the status of a CHECKBOX from the form!

Results 1 to 3 of 3

Thread: PLEASE HELP!! Problem with getting the status of a CHECKBOX from the form!

  1. #1
    Bijal Guest

    Default PLEASE HELP!! Problem with getting the status of a CHECKBOX from the form!

    Hi all,<BR><BR>I have two ASP files. One of them displays an HTML form that reads data from the ACCESS database and displays all the records in the form. The user can make changes in these records through the form. On submitting the form (using the GET method) the other ASP file runs where i update the changes made in those records to the database.<BR><BR>Now i have a CHECKBOX in the form whose status i need to know in my other ASP file where i update the records.<BR>the piece of code that i use is as follows:<BR><BR>If (Request.QueryString("appAdmitted" & cnt)="True") Then<BR> app_Admitted = "Y"<BR>Else<BR> app_Admitted = "N"<BR>End If<BR><BR>the corresponding field in the database accepts the value Y / N.<BR>everytime i try to update the records, the "app_Admitted" is assigned "N" for each record, even though the checkbox is checked in the form.<BR><BR>i have tried to use a checkbox (or Yes/No) datatype for that field in the database too, but it doesn&#039t work with that either.<BR><BR>so please help me out!<BR><BR>Thanks,<BR>Bijal.

  2. #2
    KPW Guest

    Default RE: PLEASE HELP!! Problem with getting the status of a CHECKBOX from the form!

    When the value of a checkbox is passed in a form, it is set either to "on" if the checkbox is checked, or nothing (that is, no value is passed) if the checkbox is not checked.

  3. #3
    Join Date
    Dec 1969
    Posts
    168

    Default The Checkbox solution!

    &#060;% <BR>if (CInt(Request.Form("Checkbox_Name") = "on") = -1) then <BR>checkboxstatus="Checked" <BR>else <BR>checkboxstatus="Not Checked" <BR>end if <BR>Response.Write("The check box status is: " & checkboxstatus)<BR>&#037;&#062;<BR><BR>Hope this helps... Cheers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •