[eluser]gdawson[/eluser]
I was able to get this to work. Below is the resulting code.
JS
Code:
$(function() {
// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
$( "#dialog:ui-dialog" ).dialog( "destroy" );
var note = $( "#note" ), allFields = $( [] ).add( note );
$( "#dialog-form" ).dialog({
autoOpen: false,
height: 450,
width: 450,
modal: true,
buttons: {
"Add Note": function() {
var bValid = true;
allFields.removeClass( "ui-state-error" );
if ( bValid ) {
note.val()
document.noteform.submit();
$( this ).dialog( "close" );
}
},
Cancel: function() {
$( this ).dialog( "close" );
}
},
close: function() {
allFields.val( "" ).removeClass( "ui-state-error" );
}
});
$( "#create-note" )
.button()
.click(function() {
$( "#dialog-form" ).dialog( "open" );
});
});
[removed]
HTML
Code:
<button id="create-note">Add Note</button>
<div id="dialog-form" title="Add Note">
<form action="<?= base_url();?>notes/addNote/" method="post" name="noteform" id="noteform">
<fieldset>
<label for="note"></label>
<textarea type="text" cols="25" rows="10" name="note" id="note" class="text ui-widget-content ui-corner-all" ></textarea>
</fieldset>
</form>
</div>
Controller
Code:
newNote = $this->input->post('note');