Form jqueryvalidation validate

Form jqueryvalidation validate

Hello 

I use from jqueryvalidation.org the part demo/multipart. All is working fine but at least I don't know how I can include in the validation I used before. In my form before i added a onsubmit function. With the step by step form the validation with onsubmit will be to late. I need to validate in the first step two fileds (KRegSumme and KRate).

how can I include in the multipart demo code like this:

  1. function myvalidate()
  2. {
  3.         var a = document.forms[0].KRegSumme.value;
  4.         var b = document.forms[0].KRate.value;
  5.         
  6.         var r = parseFloat(a);
  7.         var m = parseFloat(b);
  8.        
  9.         if (r > 100*m)
  10.         {
  11. document.getElementById('error').style.display = 'block';
  12. document.getElementById('error').innerHTML = 'La quota mensile deve essere uguale o superiore all 1% del totale dell´importo richiesto!';
  13. return false;
  14. if (m > r/2)
  15. {
  16. document.getElementById('error').style.display = 'block';
  17. document.getElementById('error').innerHTML = 'La quota mensile non potrá essere superiore al 50% dell´importo richiesto!';
  18. return false;
  19. }
  20. }