On Aug 26, 6:25 am, Saurav Chakraborty <rails-mailing-l...@andreas-
s.net> wrote:> Hi,
>
> Can anybody tell me how to pass a value to a javascript function from a
> partial form. I have done client side validation from rhtml pages having
> forms in the following manner :
>
> <TD><%= f.text_field :first_name, :onChange => ("return
> checkName(this.form.first_name.value'');") %></TD>
>
> But since in a partial form there is not form tag, how can i pass the
> value to a javascript function?
Surely if you''ve got f (which I assume is a form builder) then this
partial will always be rendered inside a form? It doesn''t matter if
the form is inside the partial or not, the browser will never know.
However, in your onChange ''this'' should be the text field so
this.value should work.
Fred>
> -Thanks
> Saurav
> --
> Posted viahttp://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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---