Disable Enable unobtrusive validation for specific submit button?

Jack the button click for form submission using JavaScript.

Jack the button click for form submission using JavaScript. Here is good example with jQuery: $("#MyButton"). Click(function(e) { //submit your form manually here e.preventDefault(); }).

I attached an event handler to certain buttons, that altered the settings of the validator object on that particular form. $(". JsCancel").

Click(function (e) { $(e. CurrentTarget). Closest("form").validate().settings.

Ignore = "*" }); This has worked like a charm for me in MVC3. I don't know if this helps you in particular, but since I use ajax form, I had to attach the event to these buttons each time the contents of the ajax form was replaced, by using the event ajax success. The full code that reparses the form and attaches the event to the cancel buttons is: $(document).

AjaxSuccess(function (event, xhr, settings) { var $jQval = $. Validator, adapters, data_validation = "unobtrusiveValidation"; $jQval.unobtrusive. Parse(document); $(".

JsCancel"). Click(function (e) { $(e. CurrentTarget).

Closest("form").validate().settings. Ignore = "*" }); }).

Thank you. I have solved this problem by adding "cancel" class to my button when Content were generated. I have question for you What does this selector means ".

JsCancel"? And did you try use this $(". JsCancel").

Live("click", ... instead this $(". JsCancel"). Click(function (e)... – Sergii Dec 17 '11 at 14:56 Adding the cancel class didn't work for me, hence my work-around.

We usually prefix the css classes with js, if they are used for finding elements rather than styling. I put that class on my submit-buttons that should not validate the form. I suppose live() or on() would work as well, I am just not that used to using it.

– Skymt Dec 21 '11 at 12:00.

I attached an event handler to certain buttons, that altered the settings of the validator object on that particular form.

Hijack the button click for form submission using JavaScript.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions