I have four buttons on my page
<button id="opener" >Submit Timecard</button>
<button id="cancel" class="cancel">Cancel</button>
<input type="button" onclick="AddPO();" class="cancel" id="btnAddPO" name="btnAddPO" value="Add More Part Details"/>
<input type="button" name="btnAddMoreReciepts" id="btnAddMoreReciepts" value="Add More Reciepts" onclick="AddReciepts();" class="cancel" />
When the Submit Timecard is clicked the form should validate.
for the rest of the buttons it should not so I added the class cancel.
But if I Click btnAddPo or btnAddMoreReciepts first and click the SubmitTimecard the form is not getting validated.
Can anyone tell me a good solution for this
Thanks,
Sravanthi
I assume you have a javascript function for validate(). You can bind that function to the click handler for just the button you need.
This is a very general solution, and you can also include the validation function on the form submit action.