I didn't know of a good JS list
I have the code below. The if loop seems to kill the script. The IF
loop runs fine but the alert after the FOR and everything after the
FOR for that matter, fail to execute.
function Validator() {
var myform = document.getElementById('SuggestionForm');
var errMsg = ''
var checkboxcounter = 0
if (myform.SuggestionText.value == '')
errMsg = errMsg + '- Please explain your
suggestion.\n\r'
if (myform.SuggestTitle.value == '')
errMsg = errMsg + '- Your suggestion needs a title.\n\r'
alert(myform.Impact.length);
for (i = 0; i <= myform.Impact.length; i++)
{
if (myform.Impact[i].checked) {
alert('true');
checkboxcounter++;
}else{
alert('false');
}
}
alert('hi');
alert(checkboxcounter);
if (errMsg != '')
alert(errMsg)
else
myform.submit()
}
Any thoughts.
--
John Wilker
Writer/Web Consultant
www.red-omega.com
"I balance, I weave, I dodge, I frolic, and my bills are all paid. On
weekends, to let off steam, I participate in full-contact origami."
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:195053
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54