[LRUG] submit_to_remote insert value in AJAX request with JS

Riccardo Tacconi rtacconi at gmail.com
Thu Apr 29 10:37:08 PDT 2010


I have this tag:

<%=submit_to_remote 'Save', "Save",
                    :update => "posts",
                    :url => { :controller => "questions",
                              :action => 'save_remote',
                              :id => question.id,
                              :answer =>
CGI::escape('$(answer_area).getValue();') } %>

I would like to send a value taken from a text area using JavaScript. The
problem is that the function use my JS as a string. do you now a way to send
some text using submit_to_remote? In the same page I have other submit
button, but this one shound just update the text without
redirecting/reloading the page.

-- 
Riccardo Tacconi
Web developer at Wolseley UK
VIRTUELOGIC LIMITED (Director)

http://www.linkedin.com/in/riccardotacconi
http://riccardotacconi.blogspot.com/
http://twitter.com/rtacconi
Linux user: #400461
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20100429/5bb94d53/attachment.html>


More information about the Chat mailing list