I am trying to use a form to send an prototype ajax request to a php script via post and then display an alert window for success and failure
I am currently using this code
<div id="reservationRequestForm">
<form name="requestReservationForm" method="post" onsubmit="new Ajax.Request('admin/process/process_reservation_request.php', {onSuccess: function() {alert('Success');} , onFailure: function() {alert('Failure');}, method:'post'}; return false;">
....
<input type="submit" class="buttonGreen" value="Send Request" onClick="hideDiv('reservationRequestForm');"/>
</form>
</div>
I do not want the response to be processed either (it is empty anyways). I only want to know if it succeeded or failed.
In addition. I would like the form to degrade gracefully when js is disabled.
Right now this code does nothing. What am I doing wrong?