I tried several things but admittedly am not sure what they do, only that they didn't work.
<input type="checkbox" name="Location[1]" value="News-Leader.com">News-Leader (News-Leader.com)</input><br> <input type="checkbox" name="Location[2]" value="MomsLikeMe.com">Ozarks Moms (MomsLikeMe.com)</input><br> <input type="checkbox" name="Location[3]" value="OzarksSpaces.com">Spaces (OzarksSpaces.com)</input><br> <input type="checkbox" name="Location[4]" value="OzarksSignature.com">Signature (OzarksSignature.com)</input><br> <input type="checkbox" name="Location[5]" value="BaxterBulletin.com">The Baxter Bulletin (BaxterBulletin.com)</input><br> <input type="checkbox" name="Location[6]" value="MyGuideon.com">The Guideon (MyGuideon.com)</input><br>
Then at the bottom the java script:
<script language="Javascript" type="text/javascript">
function validForm(workorderNew) {
if (workorderNew.Location.value == "") {
alert("You must enter a Location");
workorderNew.Location.focus();
workorderNew.Location.select();
return false;
}
Well I have been scanning the forums and tried this but it doesn't work either, it just automatically sends the form without checking the form fields.
#
// Get the checkbox array length and iterate it to see if any of them is selected
#
for (var i = 0; i < chks.length; i++)
#
{
#
if (chks[i].checked)
#
{
#
hasChecked = true;
#
break;
#
}
#
}
#
// if ishasChecked is false then throw the error message
#
if (!hasChecked)
#
{
#
alert("Please select at least one language.");
#
chks[0].focus();
#
return false;
#
}
The HTML still looks like:
<input type="checkbox" name="Location[]" id="location1" value="News-Leader.com">News-Leader (News-Leader.com)</input><br>
Really need some help I'm stuck....
Thanks in Advance for points in the right direction
This post has been edited by Terion: 30 October 2008 - 08:43 AM

New Topic/Question
Reply



MultiQuote






|