I know this isnt a javascript help forumn, but you guys have provided the best help I've found yet...
The following script should take checkboxes and turn what the user selects into a comma-delimited string, but is returning nothing more than a string with the word 'undefined' repeated in it.
Any ideas?
<pre>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function make_array(list)
{
var list = window.document.forms[0].list;
var poo = window.document.forms[0].poo;
for (i = 0; i < list.length; i++)
{
if(poo.value == "")
poo.value = list.value
else
poo.value = poo.value + ", " + list.value;
}
alert(poo.value);
return (poo.value);
}
// End -->
</script>
</head>
<body>
<form name=aform action="" method=post>
<table>
<tr><td>
<input type=checkbox name="list" value="1">1<br>
<input type=checkbox name="list" value="2">2<br>
<input type=checkbox name="list" value="3">3<br>
<input type=checkbox name="list" value="4">4<br>
<input type=checkbox name="list" value="5">5<br>
<br>
<input type="hidden" name="poo" value="">
<input type="button" value="make string" onClick="make_array(list)">
</td></tr>
</table>
</form>
</body>
</pre>