Passing form element value with link_to_remote

Hi
i have form like

<%= text_field_tag 'transfer_reason' %>
Should fill description
<%= link_to_remote "#{flow_item.action_name}", { :success => "modal_window_for_transfer_reason.close();", :failure => "$('description_nil_div').show( )", :url => { :action => :edit_service_desk_status_after_transfer, :sd_id => @sd_ticket.id, :status_id => flow_item.flow_item_id, } }, :class => "itlink1"%>

How can I pass the text_field transfer_reason with link_to_remote

Thanks in advance
Sijo

On 5 May 2008, at 10:54, Sijo Kg wrote:

How can I pass the text_field transfer_reason with link_to_remote

Use the :with option

Fred

use the :with parameter:
http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html#M000958

something like:
:with => “‘transfer_reason=’ + $(‘transfer_reason’).value”
should work

Hi
Thanks for your help…I could solve with :submit option of
link_to_remote

Sijo

:with is good for one or two fields; :submit is better if you have an
HTML container (e.g., div) that contains several input elements that
need to be submitted.

If you’re still rendering input forms in tables, you could use the
table or tablerow as the container. It might be good for the long-
term maintenance of the project to pick one way and favor that even if
it is less than optimal for one or two instances.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs