This is a migrated thread and some comments may be shown as answers.

Bypass Validation

2 Answers 201 Views
Validation
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 15 Jan 2015, 07:46 PM
I have a form with both a submit and cancel button.  I am performing validation on multiple fields when they lose focus and when the form is submitted.  Is there anyway to bypass validation when the cancel button is clicked? 

2 Answers, 1 is accepted

Sort by
0
James
Top achievements
Rank 1
answered on 16 Jan 2015, 05:38 PM
I found this post in the forum with a similar problem but I am not sure what they mean by not attaching the validator to the form element.  I have looked at the samples and I believe I am doing the same thing.  However, my data is still be validated when I click the cancel button.
0
James
Top achievements
Rank 1
answered on 16 Jan 2015, 08:15 PM
After some more reading and trial and error, I did get this to work like explained in the question linked in my previous post.  I simply chose another "container" when attaching my validator.  I then had to add onclick logic to my buttons where I wanted validation to occur.
Tags
Validation
Asked by
James
Top achievements
Rank 1
Answers by
James
Top achievements
Rank 1
Share this question
or