gilbertsavier
04 Aug 2009, 05:42 AM
Hi,
I need some code which can give an array some values, depending on which checkboxes which is selected.
I think I will give these checkboxes (lets say 10 checkboxes) some values, and when you have selected the relevant checkboxes, you will have to click a button: "Create array". Then a array is created, and it will have the same number of values as there are checkboxes selected. And the values in the array will be the values of the selected checkboxes.
If I, for instance, select checkbox number 1, 4 and 7, and I click "Create array", the content of the array will be: 1,4,7
What will the code be for that. I donīt have the javascript code, only the HTML:
HTML Code:
<input type="checkbox" name="alotofcheckboxes" value="1" />
<input type="checkbox" name="alotofcheckboxes" value="2" />
<input type="checkbox" name="alotofcheckboxes" value="3" />
<input type="checkbox" name="alotofcheckboxes" value="4" />
<input type="checkbox" name="alotofcheckboxes" value="5" />
<input type="checkbox" name="alotofcheckboxes" value="6" />
<input type="checkbox" name="alotofcheckboxes" value="7" />
<input type="checkbox" name="alotofcheckboxes" value="8" />
<input type="checkbox" name="alotofcheckboxes" value="9" />
<input type="checkbox" name="alotofcheckboxes" value="10" />
<br><br>
<input type="button" value="Create array" onclick=???????????
------------------------------------
Thanks & regards
Lokananth
Live Chat Software (http://www.mioot.com) By miOOt
I need some code which can give an array some values, depending on which checkboxes which is selected.
I think I will give these checkboxes (lets say 10 checkboxes) some values, and when you have selected the relevant checkboxes, you will have to click a button: "Create array". Then a array is created, and it will have the same number of values as there are checkboxes selected. And the values in the array will be the values of the selected checkboxes.
If I, for instance, select checkbox number 1, 4 and 7, and I click "Create array", the content of the array will be: 1,4,7
What will the code be for that. I donīt have the javascript code, only the HTML:
HTML Code:
<input type="checkbox" name="alotofcheckboxes" value="1" />
<input type="checkbox" name="alotofcheckboxes" value="2" />
<input type="checkbox" name="alotofcheckboxes" value="3" />
<input type="checkbox" name="alotofcheckboxes" value="4" />
<input type="checkbox" name="alotofcheckboxes" value="5" />
<input type="checkbox" name="alotofcheckboxes" value="6" />
<input type="checkbox" name="alotofcheckboxes" value="7" />
<input type="checkbox" name="alotofcheckboxes" value="8" />
<input type="checkbox" name="alotofcheckboxes" value="9" />
<input type="checkbox" name="alotofcheckboxes" value="10" />
<br><br>
<input type="button" value="Create array" onclick=???????????
------------------------------------
Thanks & regards
Lokananth
Live Chat Software (http://www.mioot.com) By miOOt