function checkInt(field, low, high, def) { i=parseInt(field.value); if ((isNaN(i)) || (i high)) { window.alert("Please enter a number between "+ low + " and " + high ); field.value=def; field.focus(); } } function checkFloat(field, low, high, def) { i=parseFloat(field.value); if ((isNaN(i)) || (i high)) { window.alert("Please enter a number between "+ low + " and " + high ); field.value=def; field.focus(); } } function checkEndorser(field) { if (field.value.length>5) { document.supporterform.Endorser.checked=true; } else { document.supporterform.Endorser.checked=false; } } function checkContributorForm(contributorform) { returncode=true; msgiffalse=""; if (contributorform.First_Name.value.length==0) { msgiffalse=msgiffalse+"* Please enter a first name\n"; returncode=false; } if (contributorform.Last_Name.value.length==0) { msgiffalse=msgiffalse+"* Please enter a last name\n"; returncode=false; } if (contributorform.Street_1.value.length==0) { msgiffalse=msgiffalse+"* Please enter a street address\n"; returncode=false; } if (contributorform.City.value.length==0) { msgiffalse=msgiffalse+"* Please enter a city\n"; returncode=false; } if ((contributorform.Zip.value.length!=5) && (contributorform.Zip.value.length!=9)) { msgiffalse=msgiffalse+"* Please enter a valid ZIP code\n"; returncode=false; } radio_amount=0; for (counter = 0; counter < contributorform.contribution_amount.length; counter++) { if (contributorform.contribution_amount[counter].checked) { radio_amount=contributorform.contribution_amount[counter].value; } } if (radio_amount==-1) { myamount=contributorform.contribution_amount_other.value; } else { myamount=radio_amount; } if (!(parseInt(myamount)>=5 && parseInt(myamount)<=500) || (parseInt(myamount)!=myamount) ) { msgiffalse=msgiffalse+"* Contribution amount must be whole dollar amount greater than $5 and less than maximum allowable contribution.\n"; returncode=false; contributorform.contribution_amount_other.value=''; } if (returncode==false) {window.alert(msgiffalse);} return returncode; }