Brachole
05-30-2010, 11:55 AM
I have this Checkbox Array working but I need to add a text field with each checkbox to my form. Here's my form:
<form method=post action=form-checkboxck.asp>
<input type=checkbox name=t1 value='cricket'>Bedroom<input type="text" name="f1" id="f1">
<input type=checkbox name=t1 value='football'>Bathrrom<input type="text" name="f1" id="f1">
<input type=checkbox name=t1 value='tennis'>Kitchen<input type="text" name="f1" id="f1">
<input type=checkbox name=t1 value='hockey'>Basement<input type="text" name="f1" id="f1">
<input type=submit value='Submit'>
</form>
Dim mode,mode_a,accessories, accessories_a,i
mode=Request("t1")
mode_a=split(mode,",")
accessories=Request("f1")
accessories_a=split(accessories,",")
For i=LBound(mode_a) to UBound(mode_a)
Response.Write mode_a(i) + accessories_a(i) + "<br>"
next
Problem is that the text field allows the user to enter accessories and add a comma in between (i.e. case, leads, manual)
Because they add the comma, it split each accessory. So the output looks like this:
9 Case
10 Leads
Intead of:
9 Case, Leads, Manual
10 Clips, docking
<form method=post action=form-checkboxck.asp>
<input type=checkbox name=t1 value='cricket'>Bedroom<input type="text" name="f1" id="f1">
<input type=checkbox name=t1 value='football'>Bathrrom<input type="text" name="f1" id="f1">
<input type=checkbox name=t1 value='tennis'>Kitchen<input type="text" name="f1" id="f1">
<input type=checkbox name=t1 value='hockey'>Basement<input type="text" name="f1" id="f1">
<input type=submit value='Submit'>
</form>
Dim mode,mode_a,accessories, accessories_a,i
mode=Request("t1")
mode_a=split(mode,",")
accessories=Request("f1")
accessories_a=split(accessories,",")
For i=LBound(mode_a) to UBound(mode_a)
Response.Write mode_a(i) + accessories_a(i) + "<br>"
next
Problem is that the text field allows the user to enter accessories and add a comma in between (i.e. case, leads, manual)
Because they add the comma, it split each accessory. So the output looks like this:
9 Case
10 Leads
Intead of:
9 Case, Leads, Manual
10 Clips, docking