Hi guys,
Ive recently decided to add some jquery to a project im working on, so far most of what ive learned has worked well. However i am stuck with one thing.
Ive got a html form on the webpage that is opened up into a modal dialog, i cant seem to figure out how to get the jquery submit button to work. The button in the actual form works ok but i want to remove that and use the jquery one alongside a close button (which i have working).
Here is the code for the dialog
- $(function() {
- $( \"#popupform\" ).dialog({
- width: 500,
- modal: true,
- buttons: {
- \"Save\": function() {
- $('#createrepairform').submit();
- $(this).dialog('close');
- },
-
- \"Close\": function(){
- $(this).dialog('close');
- }
- }
- })
- });
This is the html for the form
- <div id="popupform">
- <form action="create_repair.php" method="POST" name="createrepairform" id="createrepairform">
- <input type="text" name="name" />
- <input type="text" name="email" />
- <input type="submit" name="createbtn" id="createbtn" value="Submit" />
- </form>
- </div>
So basically im trying to get the save button to post the form fields back to my php script (on same page).
Any ideas where i might be going wrong?