0

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.

1
  • Wouldn't a $('#dialog-form form').submit() work? Commented Aug 15, 2012 at 18:35

1 Answer 1

1

I guess you just want to submit the form?

$(this).find('form').submit();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.