I have been building a page where an administrator of the page can come look at some abstracts that have been submitted. I have used jquery to insert a modal-form where they can categorize the abstract to fit within one of five choices(four sessions, and one n/a). However, I am stuck on the function in the script.
What I want it to do is to go to the .php page where I'll have the appropriate code written to UPDATE the record in the database, then send the administrator back to the main page, to continue categorizing abstracts if they wish.
I have the form:
<div id="dialog-form" title="Categorize this abstract">
<p class="validateTips">Please select one session for this abstract.</p>
<form method="post" action="savecat.php">
<fieldset>
<label><input type="radio" name="abstractcategory" value="session1" />Session 1</label>
<label><input type="radio" name="abstractcategory" value="session2" />Session 2</label>
<label><input type="radio" name="abstractcategory" value="session3" />Session 3</label>
<label><input type="radio" name="abstractcategory" value="session4" />Session 4</label>
<label><input type="radio" name="abstractcategory" value="NULL" />Irrelevant</label>
</fieldset>
</form>
</div>
In the script I have the categorize button:
$( "#categorize" )
.button()
.click(function() {
$( "#dialog-form" ).dialog( "open" );
});
And this is where I'm not sure what to do, in the dialog-form function:
$( "#dialog-form" ).dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: {
"Categorize this abstract": function() {
What should I put here? I don't know. I want it to re-direct(?) to the savecat.php that is the action of the form.
Then there's the rest, to cancel, close, etc.
$( this ).dialog( "close" );
}
},
Cancel: function() {
$( this ).dialog( "close" );
}
},
close: function() {
allFields.val( "" ).removeClass( "ui-state-error" );
}
});
Can anyone point me in the right direction? I have a feeling it's a simple thing that I just am unaware of.
$('#dialog-form form').submit()work?