Forum: Ruby on Rails Link_to_remote with dynamic textbox

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Dylan M. (Guest)
on 2006-02-07 20:25
(Received via mailing list)
I'm trying to build a custom spell-checker. When an incorrect word is
found, a select list is populated with suggestions, and when a
suggestion is clicked, a "replacement_text" textbox is populated with
the value. I'd like to be able to use a link_to_remote item to update
the item. However, I can't figure out how to pass the parameter to my
"replace" action in my controller. I've tried:

        :update => "id__#{word_count}",
        :url => {
            :action => 'replace',
            :id => word_count,
            :with => "$('replacement_text').value"

but the literal "$('replacement_text').value" gets submitted rather than
the actual value of the "replacement_text" box.
This topic is locked and can not be replied to.