Forum: Ruby on Rails form_for with :onsubmit

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Maite .. (Guest)
on 2009-01-30 14:19
hello list

I have a problem with form_for and :onsubmit

this is may code

<div id="note">
<% javascript_tag do %>
function valor(){
<% end %>

<% form_for :accion, :url=>{:controller=> "accions", :action=>
"anadir"}, :html=>{:onsubmit=>"valor();"} do |f| %>

<%= f.submit "Go" %>
<%end %>


when I click in buttom nothing happen with javascript function valor(),
I don´t see the alert

this is my html code
<div id="note">
<form onsubmit="valor();" method="post" action="/accions/anadir">
<div style="margin: 0pt; padding: 0pt;">
<table width="700" border="1">

but i don´t find the javascript code of javascript_tag

any idea???

thanks for all
This topic is locked and can not be replied to.