Johannes wrote:> hey!
>
> clicking "login" opens (ajax) a login form (partial) on my site.
>
> this partial includes the form and javascript block.
> looks like this:
>
> <script ... >
> function validate() {
> // check form fields
> }
> </script>
> <form ...>
>
> </form>
>
> the problem is: if i try to call the validate-function from inside the
> form (<input onkeyup="validate()"...) i''m getting a
js error:
>
> validate() is not defined
>
> Why isn''t that function available on my site after the partial is
loaded
> ?
>
> thx alot
Rendering a partial with Ajax usually requires the evalScripts parameter
(http://prototypejs.org/api/string/evalScripts).
I''d give that a try, otherwise just include that javascript method in
the initial page where you render the login form, that way the
javascript will surely be evaluated.
Hope that helps,
- Eric
--
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
-~----------~----~----~----~------~----~------~--~---