Hi! I currently have an item being pulled from a database that has a couple of additional ingredients that are associated with (for example, an oatmeal cookie with additional ingredients of raisins or nuts). The additional ingredients are put into checkboxes, named the same, and then passed to a javascript that process the checkboxes and puts them into one variable. So if they choose both the final variable will look like: Oatmeal Cookie: raisins nuts.

Okay, onto my problem. When I have more than one custom ingredient, it works perfectly, when I have one custom ingredient it doesn't work - basically just doesn't give me the value of the checkbox. Below is the code (I'm a newbie), so any help is TRULY appreciated:

There is a possibility an item won't have any custom ingredients, so that form field won't be generated...that's why I have the ==null in there too!

// This is the custom additions checker
if (thisForm.ADDITIONALINFO == null) {
strADDTLINFO = "<br>";
} else {
for (var i = 0; i < thisForm.ADDITIONALINFO.length; i++)
{
if (thisForm.ADDITIONALINFO[i].checked)
{
// one box checked, go to next validation
var mess = "good";
break;
} else {
var mess = "notgood";
}
}

if ( mess == "notgood" ) {
strADDTLINFO = "<br><b>No Custom Additions</b>";
} else {
var checkboxval = "<br><b>Custom Additions:</b> ";
for (var i = 0; i < thisForm.ADDITIONALINFO.length; i++)
{
if (thisForm.ADDITIONALINFO[i].checked)
{
checkboxval = checkboxval + thisForm.ADDITIONALINFO[i].value + "&nbsp;";
}
}
strADDTLINFO = checkboxval;
}
}