stevem2004
10-03-2004, 03:04 PM
Hi, I am trying to create a table of input boxes, based on what checkboxes have been ticked.
I have the following code for the checkbox part
<td><input type="checkbox" name="vehicletype" value="carls" id="vehicletype"></td>
<td><input type="checkbox" name="vehicletype" value="car5d" id="vehicletype"></td>
<td><input type="checkbox" name="vehicletype" value="car3d" id="vehicletype"></td>
Then to build the table I am using:-
If vehicletype = carls Then Response.Write"<tr><td class=""normal"">Red Car Single <input type=""text"" name=""redcarls"" size=""8"" maxlength=""6"" class=""form""></td><td class=""normal"">Yellow Car Single <input type=""text"" name=""yelcarls"" size=""8"" maxlength=""6"" class=""form""></td><td class=""normal"">Green Car Single <input type=""text"" name=""grecarls"" size=""8"" maxlength=""6"" class=""form""></td></tr>" End If
If vehicletype = car5d Then Response.Write"<tr><td class=""normal"">Red Car 5 Day <input type=""text"" name=""redcar5d"" size=""8"" maxlength=""6"" class=""form""></td><td class=""normal"">Yellow Car 5 Day <input type=""text"" name=""yelcar5d"" size=""8"" maxlength=""6"" class=""form""></td><td class=""normal"">Green Car 5 Day <input type=""text"" name=""grecar5d"" size=""8"" maxlength=""6"" class=""form""></td></tr>" End If
But this does not work properly, no matter what is selected, the table displays all the inputboxes.
Can someone tell me what I am doing wrong? Or am I approaching this the wrong way?
TIA
Steve
I have the following code for the checkbox part
<td><input type="checkbox" name="vehicletype" value="carls" id="vehicletype"></td>
<td><input type="checkbox" name="vehicletype" value="car5d" id="vehicletype"></td>
<td><input type="checkbox" name="vehicletype" value="car3d" id="vehicletype"></td>
Then to build the table I am using:-
If vehicletype = carls Then Response.Write"<tr><td class=""normal"">Red Car Single <input type=""text"" name=""redcarls"" size=""8"" maxlength=""6"" class=""form""></td><td class=""normal"">Yellow Car Single <input type=""text"" name=""yelcarls"" size=""8"" maxlength=""6"" class=""form""></td><td class=""normal"">Green Car Single <input type=""text"" name=""grecarls"" size=""8"" maxlength=""6"" class=""form""></td></tr>" End If
If vehicletype = car5d Then Response.Write"<tr><td class=""normal"">Red Car 5 Day <input type=""text"" name=""redcar5d"" size=""8"" maxlength=""6"" class=""form""></td><td class=""normal"">Yellow Car 5 Day <input type=""text"" name=""yelcar5d"" size=""8"" maxlength=""6"" class=""form""></td><td class=""normal"">Green Car 5 Day <input type=""text"" name=""grecar5d"" size=""8"" maxlength=""6"" class=""form""></td></tr>" End If
But this does not work properly, no matter what is selected, the table displays all the inputboxes.
Can someone tell me what I am doing wrong? Or am I approaching this the wrong way?
TIA
Steve