erypmav
05-24-2006, 05:58 PM
Hello!
I have a very simple thing I want to do but am not a very experienced coder. I have a set of 5 checkboxes that I would like to concatenate the values of with text.
Example:
<tr>
<td><input type="checkbox" name="IND" value="1" checked>One</td>
<td><input type="checkbox" name="IND" value="2">Two</td>
<td><input type="checkbox" name="IND" value="3">Three</td>
<td><input type="checkbox" name="IND" value="4">Four</td>
<td><input type="checkbox" name="IND" value="5">Five</td>
</tr>
I'm looking for a funtion that will dump text into a variable. The text should read:
"WHERE TYPE EQ <value of checkbox> OR <value of checkbox>"...etc... depending upon how many have been selected.
So, if the user checks 'two', 'four' and 'five' then the text should read "WHERE TYPE EQ 2 OR 4 OR 5"
If they only pick 'one', then the text should read "WHERE TYPE EQ 1"
I'm guessing it should be a loop where the value of IND eq 'checked' but I've never dealt with these before and I'm lost.
Thanks in advance for your help!
I have a very simple thing I want to do but am not a very experienced coder. I have a set of 5 checkboxes that I would like to concatenate the values of with text.
Example:
<tr>
<td><input type="checkbox" name="IND" value="1" checked>One</td>
<td><input type="checkbox" name="IND" value="2">Two</td>
<td><input type="checkbox" name="IND" value="3">Three</td>
<td><input type="checkbox" name="IND" value="4">Four</td>
<td><input type="checkbox" name="IND" value="5">Five</td>
</tr>
I'm looking for a funtion that will dump text into a variable. The text should read:
"WHERE TYPE EQ <value of checkbox> OR <value of checkbox>"...etc... depending upon how many have been selected.
So, if the user checks 'two', 'four' and 'five' then the text should read "WHERE TYPE EQ 2 OR 4 OR 5"
If they only pick 'one', then the text should read "WHERE TYPE EQ 1"
I'm guessing it should be a loop where the value of IND eq 'checked' but I've never dealt with these before and I'm lost.
Thanks in advance for your help!