
The below code is nit working in Google chrome can any one tell me the solution as soon as possible.
<script type="text/javascript">
<!--
function setValue(){
var val="";
var frm = document.getElementById("SearchCandForm");
var cbs = document.getElementById("SearchCandForm").checkboxname;
for(var n=0;n<cbs.length;n++){
if(cbs[n].checked){
val+=cbs[n].value+",";
}
}
var temp = val.split(",");
temp.pop();
frm.textname.value=temp
}
//-->
</script>
</head>
<body class="body">
<form name="SearchCandForm">
<input type="checkbox" name="checkboxname" value="coffee" onclick="setValue();">
<input type="checkbox" name="checkboxname" value="tea" onclick="setValue();">
<input type="text" name="textname">
</form>
Regards, Santhosh.