Hi,

I am trying to update the textarea with the checkboxvalues.

when checkboxa is checked,

checkbox1, checkbox2, checkbox3 are checked and their values should be shown in textarea like 1,2,3

if checkbox1 is unchecked the textarea should show 2,3

same thing applies to checkbox2 and checkbox3

below is the code where i attempted to do it.

Can someone tell me how to do it


<script language="JavaScript" type="text/javascript" src="jquery/jquery.min.js"></script>

<input type="checkbox" class="checkboxa">
<input type="checkbox" class="checkbox1" value="1">
<input type="checkbox" class="checkbox1" value="2">
<input type="checkbox" class="checkbox1" value="3">

<input type="checkbox" class="checkboxb">
<input type="checkbox" class="checkbox2" value="4">
<input type="checkbox" class="checkbox2" value="5">
<input type="checkbox" class="checkbox2" value="6">

<textarea rows="6" cols="100" id="checkboxvalue"> </textarea>







<script language="JavaScript" type="text/javascript">
<!--
$('.checkboxa').click(function(){
var status = this.checked;
var allvals = [];
$('.checkbox1').each(function(){
this.checked = status;

allvals.push(this.val());
})

$("#checkboxvalue").text(allvals);

});


$('.checkboxb').click(function(){
var status = this.checked;
$('.checkbox2').each(function(){
this.checked = status;
})
});



//-->
</script>



Thanks