I hv a form where I hv 2 submit buttons (the one we discussed, where putting emp ID populates employee name etc)
One submit button does the work of populating the employee details when I enter Emp ID and click on it.
The other submit button submits the form data to DB when I fill up the form and click on submit.
Now before the form data is submitted, I want to validate whether each field is correctly filled so I am uisng Java script for this.
And I am uisng this statement to validate.
<form action= "form.php" method="post" enctype="multipart/form-data" name="myform" id="myform" onsubmit="return (formCheck(this) && validateit(this.Hr_ticket.value));">
With the above code, even if I click on the submit button that populates the employee details, it shows up the Java script validation. I only want the JS validation for the submit button that actually puts the form data into DB.
One submit button does the work of populating the employee details when I enter Emp ID and click on it.
The other submit button submits the form data to DB when I fill up the form and click on submit.
Now before the form data is submitted, I want to validate whether each field is correctly filled so I am uisng Java script for this.
And I am uisng this statement to validate.
<form action= "form.php" method="post" enctype="multipart/form-data" name="myform" id="myform" onsubmit="return (formCheck(this) && validateit(this.Hr_ticket.value));">
With the above code, even if I click on the submit button that populates the employee details, it shows up the Java script validation. I only want the JS validation for the submit button that actually puts the form data into DB.