Problem with empty checkbox value

Results 1 to 2 of 2

Thread: Problem with empty checkbox value

  1. #1
    Join Date
    Dec 1969

    Default Problem with empty checkbox value

    Hi,<BR><BR>I want to pass checkbox values from one ASP page to another. The values are in an array. <BR><BR>Though I want to use If Then Else so that if the user has checked the check box, the value is displayed and if it has not been checked, another word (like &#039;No&#039;) is displayed<BR><BR>I am able to display the value of the checkbox if it has been checked, but I am having probs with it not being checked.<BR><BR>My code is below. I call in the values from the previous ASP page and split them. But then when a person hasn&#039;t ticked a box, the else statement never happens!<BR><BR>Massages = Request.form("Massage") <BR>Massages = Split(Massages, ",")<BR>For Each Massage in Massages <BR>if Massage="Massage" then %&#062; <BR>&#060;b&#062;Yes&#060;/b&#062;<BR>&#060;% else %&#062;<BR>&#060;b&#062;No&#060;/b&#062;<BR>&#060;% end if <BR>Next %&#062; <BR><BR>Can anyone please shed some light on this please?<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Problem with empty checkbox value

    When a checkbox is not ticked, it&#039;s value is not posted, so Request.form("Massage") only contains the values of the checkboxes that are checked.<BR><BR>To figure out what checkboxes were not ticked, you will need to compare the posted values with all the possible values.

Posting Permissions

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