Setting submit value in jQuery submit

Viewed 42185

I want to use jQuery to submit my form and i can do that like so

  $('#myform_id').submit();

and thats all good but normally someone clicks a submit button than that submit button has a value so when I do the submit via jQuery I also need to set a submit value how do i do that ?

EDIT

as noted by some answers I could do this by simulating a user click but I don't want to do that I want to pass the submit value when I use the .submit() command if that is possible

ultimately the submit using ajax form

** Clarifying **

ok so I have jQuery setup to use jquery validate and has a submit handler like so

$("#myform_id").validate({
    submitHandler: function() {
        run_ajax(obj);
    }
});

then that calls I function i call run_ajax passing and object containing information about what type of ajax i want and what have you.

and ultimately runs this

obj.formitem.ajaxSubmit({
    dataType:'json',
    data: obj.pdata,
});

where

  obj.formitem == $('#myform_id');

so when the form is submit all that happens all good.

so I load the page with this form into jquery dialog and I want them to be able to click a button in the dialog that triggers the form submit and also tells the form what type of submit was requested

hopefully this is clear now sorry for confusion

7 Answers
Related