ruby - How to submit a form and use the result in javascript triggered by the submit button? -


i have form_tag form want submit in order values. these same values want use in javascript triggered same submit button use form.

what want first submit form , call javascript.
submit function looks that:

<%= submit_tag "submit", :onclick => "sendrequesttorecipients(); return false;" %> 

but calls javascript , doesn't submit form.

if this:
:onclick => "submit();sendrequesttorecipients(); return false;"
submit form don't call javascript.

can somehow "trigger javascript after form submitted(using result of submission)?

my javascript looks that:

function sendrequesttorecipients() { { options } , requestcallback); } 

the problem return false prevents default action of submit button.

try:

<%= submit_tag "submit", :onclick => "sendrequesttorecipients();" %> 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -