selecting data from a table based on a checkbox

Results 1 to 2 of 2

Thread: selecting data from a table based on a checkbox

  1. #1
    Steven E. Guest

    Default selecting data from a table based on a checkbox

    I am having a bit of an issue with the following:<BR><BR>I have a page that is populated via a dB, depending on which catagory is selected.<BR><BR>The data is presented to the viewer in a form with check boxes to the right of each item. (kinda like a shopping catalog)<BR><BR>I would like to pass the data (only the information that the user checks) to another form for processing.<BR><BR>I am open to any suggestions.<BR><BR>If you need more info please e-mail me<BR><BR>Thanks

  2. #2
    robob Guest

    Default try this

    &#060;%answers = request.form("answer")<BR>if answers = "" then %&#062;<BR>&#060;form action="&#060;%= request.servervariables("SCRIPT_NAME") %&#062;" method="POST"<BR>&#060;input type="checkbox" name="answer" value="1"&#062;I´m an idiot<BR><BR>&#060;input type="checkbox" name="answer" value="2"&#062;I´m blond<BR><BR>&#060;input type="checkbox" name="answer" value="3"&#062;I´m male<BR><BR>&#060;input type="submit" name="submit" value="Click here"&#062;<BR>&#060;/form&#062;<BR>&#060;%else%&#062;<BR>&#060;%= answers%&#062; &#039prinst variable answers<BR>this would be the page that is customized based on answers a user gives. if he/she checks all three answers, "answers" will contain "1,2,3". this is just a string. you can store this in an array as well, so you can access each single answer by the index number of the array. the important thing is that you give each checkbox the same name, so that it comes out as a string. they can have different names as well, but then you need to access each one individually (answer1 = request.form("answer1"), answer2 = request.form("answer2"), and so on)<BR>also, this code returns the user back to the checkbox form in case he didn´t give any answers.<BR>&#060;%end if%&#062;<BR><BR>is this what you were looking for? any questions -<BR><BR>whenever you ask people to send you an email, please specify your email address. you didn´t do that in your post (I think).

Posting Permissions

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