<%= form_tag(
"http://search2.library.oregonstate.edu/record/search")
%>
<%= text_field_tag(''query'',value="Enter
keywords",{ :size=>
"35", :accesskey=> "s"}) %>
<%= hidden_field_tag(''tab'',
value="general")%>
<%= hidden_field_tag(''group'',
value="g5")%>
<%= submit_tag ''Go'', :onclick
=>remote_function(:url =>
{:action => :store_query, :id => @mod, :page => @page, :query
=> ???? } ) %>
<%= end_form_tag %>
In the remote_function call I want to pass the text_field named
''query'' value as a param, so, :query => ???
How do I get the value out of the text field and into my param hash?
Everything else works, and I can put a static value in the query hash
and get the functionality I am looking for. But, how to get the user''s
input???
Thanks in advance, K
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Hi,
Can you make the form itself an AJAX form by using <%= form_remote_tag
...%> your view may look something like:
<%= form_remote_tag :url=>{:action=>store_query} %>
<%= text_field_tag(''query'',value="Enter
keywords",{ :size=>"35",
accesskey=>"s"}) %>
<%= hidden_field_tag(''tab'',
value="general")%>
<%= hidden_field_tag(''group'',
value="g5")%>
<%= hidden_field_tag(''id'', value=>@mod)%>
<%= hidden_field_tag(''page'', value=>@page)%>
<%= submit_tag ''Go'' %>
<% end_form_tag %>
Hope this helps!
Shawn
Kim wrote:> <%= form_tag(
"http://search2.library.oregonstate.edu/record/search")
> %>
> <%= text_field_tag(''query'',value="Enter
keywords",{ :size=>
> "35", :accesskey=> "s"}) %>
> <%= hidden_field_tag(''tab'',
value="general")%>
> <%= hidden_field_tag(''group'',
value="g5")%>
> <%= submit_tag ''Go'', :onclick
=>remote_function(:url =>
> {:action => :store_query, :id => @mod, :page => @page, :query
> => ???? } ) %>
> <%= end_form_tag %>
>
> In the remote_function call I want to pass the text_field named
> ''query'' value as a param, so, :query => ???
> How do I get the value out of the text field and into my param hash?
>
> Everything else works, and I can put a static value in the query hash
> and get the functionality I am looking for. But, how to get the
user''s
> input???
>
> Thanks in advance, K
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
No - I am calling two actions - the form action to the search tool which is
another RoR project and the remote function call which is an action in this
project. I have it working anyways - I used :with and prototype''s $F()
The solution:
:onclick =>remote_function(:url => {:action => :store_query, :id =>
@mod,
:page => @page}, :with =>
"''query=''+$F(''query'')" )
On 3/21/07, Shware
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
>
> Hi,
>
> Can you make the form itself an AJAX form by using <%= form_remote_tag
> ...%> your view may look something like:
>
> <%= form_remote_tag :url=>{:action=>store_query} %>
> <%= text_field_tag(''query'',value="Enter
keywords",{ :size=>"35",
> accesskey=>"s"}) %>
> <%= hidden_field_tag(''tab'',
value="general")%>
> <%= hidden_field_tag(''group'',
value="g5")%>
> <%= hidden_field_tag(''id'', value=>@mod)%>
> <%= hidden_field_tag(''page'', value=>@page)%>
> <%= submit_tag ''Go'' %>
> <% end_form_tag %>
>
> Hope this helps!
>
>
> Shawn
>
> Kim wrote:
> > <%= form_tag(
"http://search2.library.oregonstate.edu/record/search")
> > %>
> > <%=
text_field_tag(''query'',value="Enter keywords",{
:size=>
> > "35", :accesskey=> "s"}) %>
> > <%= hidden_field_tag(''tab'',
value="general")%>
> > <%= hidden_field_tag(''group'',
value="g5")%>
> > <%= submit_tag ''Go'', :onclick
=>remote_function(:url =>
> > {:action => :store_query, :id => @mod, :page => @page, :query
> > => ???? } ) %>
> > <%= end_form_tag %>
> >
> > In the remote_function call I want to pass the text_field named
> > ''query'' value as a param, so, :query => ???
> > How do I get the value out of the text field and into my param hash?
> >
> > Everything else works, and I can put a static value in the query hash
> > and get the functionality I am looking for. But, how to get the
user''s
> > input???
> >
> > Thanks in advance, K
>
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--
Kim Griggs
kim.griggs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
"We are all stakeholders in the Karma economy."
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---