In the Struts2 jQuery plugin, we defined forms with ajax validation. But several times, we want the form to be checked using ajax and submitted.
I see some similar problem that changed the core of the JQuery Struts 2 kernel, which I prefer not to do: struts2 jquery ajax and client side validatio do not work toghether
For the first attempt:
I add onBeforeTopics = "beforeFormSubmit" and below method:
$.subscribe("beforeFormSubmit", function(event, data) {
});
So that I can prevent form submission by subscribing to onBeforeTopics ?!
For the second approach:
I am trying to prevent form submission:
$( "#loginForm" ).submit(function( event ) {
alert('Before submit');
event.preventDefault();
});
, ! :
<s:submit/>
<sj:submit/>
javascript-?