That's correct. Here's what I came up with
precode
var arr = new Array();
Appery("guardianCheckBox").find(":checked").each(function(){
arr.push($(this).val());
});
if(typeof arr[2] !== "undefined")
{
alert("Please select only 2 guardians!");
} else {
if(typeof arr[0] !== "undefined")
{
localStorage.setItem('selectedGuardian',arr[0]);
if(typeof arr[1] !== "undefined")
{
localStorage.setItem('selectedGuardian2',arr[1]);
}
addChild.execute();
}
else
{
alert("Please select a guardian!");
}
}
/code/pre
It checks if there are multiples, or if none have been selected. This way you can have 1 OR 2, but no more or no less.
Look alright?