Hi,
Another newbie question please.
I have an HTML table that contains a number of checkbox's, each checkbox has a unique value.
I also have a textbox on the page as well.
Basically, i am trying to think of a way of appending the value of the checkbox to the textbox. Similarly, if the checkbox is deselected I want to be able to remove the value for that checkbox from the textbox. I am thinking of a comma separated list.
For example, if I have four checkboxs, their values will be 1, 2, 3, and 4.
when the page first loads, the textbox will be empty.
If I click on checkbox 1, the value of the textbox will be:
1
If i click on checkbox 4, the textbox becomes :
1,4
If I click on checkbox 3, the textbox becomes:
1,4,3
If i click on checkbox 4 again the value is removed and the textbox is:
1,3
and so on.
I know I need the onClick event of the checkbox to fire, but not sure about teh code for adding / removing the value from the list.
ANy help is appreciated.
MrPeds
Another newbie question please.
I have an HTML table that contains a number of checkbox's, each checkbox has a unique value.
I also have a textbox on the page as well.
Basically, i am trying to think of a way of appending the value of the checkbox to the textbox. Similarly, if the checkbox is deselected I want to be able to remove the value for that checkbox from the textbox. I am thinking of a comma separated list.
For example, if I have four checkboxs, their values will be 1, 2, 3, and 4.
when the page first loads, the textbox will be empty.
If I click on checkbox 1, the value of the textbox will be:
1
If i click on checkbox 4, the textbox becomes :
1,4
If I click on checkbox 3, the textbox becomes:
1,4,3
If i click on checkbox 4 again the value is removed and the textbox is:
1,3
and so on.
I know I need the onClick event of the checkbox to fire, but not sure about teh code for adding / removing the value from the list.
ANy help is appreciated.
MrPeds