edwardmlyte
edwardmlyte

Reputation: 16597

jQuery submit function on struts 1.x form

jQuery submit relies on the form having an id. With a struts html:form you cannot define the id, only a name.

$('form[name="uploadForm"]').submit(function() { 
     alert("submitting");
     // $('form[name="uploadForm"]').ajaxSubmit();
     return false; 
});

I've tried this, but the alert never shows up. Any ideas? The eventuality is to use the ajaxSubmit for a true AJAX form submit. But I'm just testing at the moment.

Upvotes: 1

Views: 1416

Answers (1)

Ryan Brodie
Ryan Brodie

Reputation: 6620

Try:

$('form[name=uploadForm]').submit(function() { 
  alert("submitting");
  // $('form[name=uploadForm]').ajaxSubmit();
  return false; 
});

Upvotes: 1

Related Questions