I’m trying to submit a form by assigning submit() to a click handler in jquery. My code is currently this:
$("#ics_alert_submit").click(function()
{
$("#ICS_upload_form").submit();
}
);
where #ics_alert_submit is a button in a jquery generated modal window and #ICS_upload_form is the id and name of the form I wish to submit.
I can’t see any reason why this isn’t working. Have I missed something really obvious?!?!
“…where #ics_alert_submit is a button in a jquery generated modal window…”
How is the submit button being generated? If it is not present when the page loads, the the click() event isn’t getting attached.
If that’s the case, you would need:
This will look for #ics_alert_submit to be dynamically added to the DOM, and will attach the event when added.