Hello, I would like to pass the values of multiple check boxes in a string, separated by a "^".
For example: RAM-VB-162^RAM-VB-154^RAM-VB-133
When the page is submitted only the last value is passed to the next page: Here is the url
http://www.ram-mount.com/wizards/test5.htm
<script language="javascript" type="text/javascript">
function compilePartsList(form){
var i = 0;
var end = form.elements.part.length;
var partsList = "";
while (i < end) {
if(form.elements.part[i].checked){
if (i>0) {
partsList += "^";
}
partsList += form.elements.part[i].value;
}
i++;
}
form.elements.partsList.value = partsList;
}
</script>
</head>
<body>
<form name="CartItem" action="https://www.ram-mount.com/RamCart/CartPutItem.php" method="POST" onsubmit="compilePartsList(this);">
<input type="checkbox" name="part" value="RAM-VB-162">
<input type="checkbox" name="part" value="RAM-VB-154">
<input type="checkbox" name="part" value="RAM-VB-133">
<input type="hidden" name="partsList" id="partsList">
<input type="submit" name="partsList" value="submit">
</form>
Thanks in advance