[eluser]gdawson[/eluser]
Let's begin by saying I am new to jquery. My issue is when I am using a jquery modal form, the post value is not being sent to the controller.
In the modal form, when clicking on "Submit Note", I am taken to the url in the form action, however the post value is not passed. Below is my simple code and any help is greatly appreciated.
I have been searching various postings but cannot figure this one out.
[removed]
Code:
$(function() {
$( "#dialog-modal" ).dialog({
height: 400,
width: 475,
modal: true,
autoOpen: false,
buttons: {
"Submit Form": function() {
($("input#newNote").val());
document.noteform.submit();
},
"Cancel": function() {
$(this).dialog("close");
}
},
close: function() {
allFields.val( "" ).removeClass( "ui-state-error" );
}
});
$( "#create-note" )
.button()
.click(function() {
$( "#dialog-modal" ).dialog( "open" );
}
);
HTML/php/Form:
Code:
<?php
$noteForm= array('name' => 'noteform', 'id' => 'noteform');
?>
<button id="create-note">Add Note</button>
<?= form_open('notes/addNote/', $noteForm) ?>
<div id="dialog-modal" title="Add Note">
<input id="newNote" type="text" name="newNote" value="" />
<?= form_close() ?>