Copy link to clipboard
Copied
Hoping someone can help me.
I have a form with a recordset where each record has a checkbox and a text field. The user check the box and enter items in the text field. On the next page, I want to display just the records where the checkboxes are checked with the items entered in the text fields.
Problem is that in the text field, the user may separate each item with a comma, which screws everything up. Here's an example.
My Form:
<form method=post action=form-checkboxck.asp>
<input name=rma type=checkbox id="rma" value='cricket'>Bedroom<input name="accessories" type="text" id="accessories" value="desk, bed">
<input name=rma type=checkbox id="rma" value='football'>
Bathrrom<input name="accessories" type="text" id="accessories" value="vanity, medicine cabinet">
<input name=rma type=checkbox id="rma" value='tennis'>
Kitchen<input type="text" name="accessories" id="accessories">
<input name=rma type=checkbox id="rma" value='hockey'>Basement<input type="text" name="accessories" id="accessories">
<input type=submit value='Submit'>
</form>
My results.asp page:
Dim mode,mode_a,accessories, accessories_a,i
mode=Request("rma")
mode_a=split(mode,",")
accessories=Request("accessories")
accessories_a=split(accessories,",")
For i=LBound(mode_a) to UBound(mode_a)
Response.Write mode_a(i) + accessories_a(i) + "<br>"
next
Right now, the above code returns the following:
6desk
7 bed
I want it to return this:
6desk, bed
7 vanity, medicine cabinet
Any idea?
Thank you!
Copy link to clipboard
Copied
Why are you putting the items into an array if you just want to output the string the user entered?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more