Skip to content Skip to sidebar Skip to footer

Onsubmit Event Not Working For Asynchronous Form Submit

I have created a form using struts tags. I have submitted the form asynchronously using struts jquery's submit tag. Now before i submit my form i want to call a javascript function

Solution 1:

In Head:

<scripttype="text/javascript">
    $.subscribe('beforeSubmit', function(event,data) {
        event.originalEvent.options.submit = checkuser();          
    });
</script>

In your tag:

<sj:submit value = "SUBMIT" 
        cssClass = "orangebuttonsmall" 
         targets = "mainContent"id = "sas" 
  onBeforeTopics = "beforeSubmit"
/>

Post a Comment for "Onsubmit Event Not Working For Asynchronous Form Submit"