passing form element value with link_to_remote

Hi    i have form like    <form>     <%= text_field_tag 'transfer_reason' %> <div id="description_nil_div" style="display: none">Should fill description</div>       <%= 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"%>

   </form>

How can I pass the text_field transfer_reason with link_to_remote

Thanks in advance Sijo

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.