[thelist] need javascript guru

Craig Saila crsaila at yahoo.ca
Thu Nov 21 23:20:00 CST 2002


Liz Hincks wrote:
> I don't want the form to submit unless the Grand Total is greater than zero.
> ( or a check box is checked)

Insert this function into the script, then call this function at the
first line of MM_validateForm():

function checkForm(){
  var form = document.form1
  if(((form.donation.checked) || (form.donation_check.checked) ||
(form.cards_check.checked)) && (form.grand_total.value > 0)) return
  else { alert("You must enter a donation amount"); return false; }

}

Definitely not the most elegant solution, but it should work...

--
Cheers,

Craig Saila
------------------------------------------
craig at saila.com  :  http://www.saila.com/
------------------------------------------





More information about the thelist mailing list