On Oct 30, 9:19 am, HUNT HUNT <[email protected]>
wrote:
> <% form_tag :action => "login", :html_options => {:onClick => "return
> validate_form(this)"} do %>
> Login: <br/><%= text_field_tag :name %><br/>
> Password: <br/><%= password_field_tag :password %><br /><br/>
> <%= submit_tag "SignIn" %>
> <% end %>
> <%= link_to 'SignUp', :action => 'signup' %>
> <%= link_to 'Forgot Password', :action => 'forgot_password' %>
>
> I wrote the above syntx for validation..using javascript the validation
> is not happening.
>
form_for understands what you mean when you do :html_options => ...,
but form_tag expects you to pass 2 option hashes: the first containing
routing options, the second containing html options. Also, do you
really want onClick rather than onSubmit ?
Fred
> The page source is below:
>
> <form
>
> action="/bloglogin?html_options%5BonClick%5D=return+validate_form%28this%29 "
>
> method="post">
>
> <div style="margin:0;padding:0;display:inline"><input
> name="authenticity_token" type="hidden"
> value="+Gy8RCXBESRKxB5ggtQfWAq4bH9cpHIvTCANLFrdlXE=" /></div>
> Login: <br/><input id="name" name="name" type="text" /><br/>
> Password: <br/><input id="password" name="password" type="password"
> /><br /><br/>
> <input name="commit" type="submit" value="SignIn" />
> </form>
> --
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---