Jump to content

mckeegan375

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mckeegan375's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for all your help guys! Joe, i used the link you posted for my solution Cheers Andy
  2. Hi All! I was hoping someone could help me with some simple JS form validation which involves a loop. So far, i have the following: <SCRIPT language=JavaScript> function validateForm() { var a = document.getElementsById('totalpayment'); var b = document.getElementsById('netpay'); for(var k=0;k<b.length;k++){ var c = a[k] var d = b[k] if (c.value > d.value) { alert("Total payment cannot be greater than net pay"); return false; } } } </script> My form has a loop which pulls data from a mysql database and it contains the fields 'totalpayment' and 'netpay' yet the validation does not display the alert if the total payment entered is greater than the net pay. Any help would be much appreciated. Cheers Andy
  3. Thanks for the help guys, i used requinix's solution in the end. Cheers Andy
  4. Hi All Was hoping someone could help me with a little validation problem. On my webpage, i have a form which has two date fields which are made of 3 drop down boxes each (DD, MM and YYYY). I am trying to make it so that a javascript message alert appears if the start date entered is before the end date but im not sure how to do it. Is there a way i can take my 3 date dropdown values and turn them into some kind of date string so that i can them go on to say if startdate > enddate then display the alert box? Any help would be greatly appreciated as i have little knowledge of javascript. Cheers Andy
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.