I have a form and here's the handler for the submit button:
$( '#submit_btn' ).click( function( data ){
theForm = document.getElementById( 'realForm' );
theForm.meetingName.value = document.getElementById( 'meeting_name' ).value;
theForm.meetingId.value = '';
theForm.description.value = document.getElementById( 'mtg_description' ).value;
theForm.startTime.value = startDate + ' ' + startTime;
theForm.endTime.value = endDate + ' ' + endTime;
theForm.loginName.value = participants;
theForm.role.value = roles;
theForm.docRights.value = docRights;
theForm.submit();
});
This handler basically pre-processes some data and sends to a hidden form, this:
<form id="realForm" style="visibility:hidden" action="/app/meeting/create" method="post">
<input name="loginName" type="text">
<input name="meetingName" type="text">
<input name="meetingId" type="text">
<input name="startTime" type="text">
<input name="endTime" type="text">
<input name="description" type="text">
<input name="roles" type="text">
<input name="docRights" type="text">
</form>
Problem is that the request isn't hitting the endpoint defined in the hidden form. What am I doing wrong here?
I've changed to make the input types hidden instead of the form. The submit handler certainly executes and, using FireBug, I don't see the request going out under the NET tab.
I'm using this dummy data to try and trigger the request but it's still not working:
theForm.meetingName.value = "MY MTG";
theForm.meetingId.value = '';
theForm.description.value = "DESC";
theForm.startTime.value = "2013-05-25 00:00:00";
theForm.endTime.value = "2013-05-25 02:00:00";
theForm.loginName.value = "foo@frr.com";
theForm.role.value = "M,M";
theForm.docRights.value = "CRUT,CRUT";