i have a form_tag with two button:
<% form_tag “/controller/action” %>
<% submit_tag ‘send’ %>
<% submit_tag ‘check’, :onclick => "javascript:… %>
<% end %>
I would if I click on check-button, javascript is ONLY called and not
the Action. And when i click the send-button the action is called.
def new
if params[:save] @val = Product.new(params[:product]) @val.save @flash[:notice]=“Supplier successfully created.”
end
if params[:check] @users = Product.find(params[:id]) @users.update_attributes(params[:product]) @flash[:notice]=“Supplier has been updated successfully.”
end
end
hi Seenu, thanks for replay.
I think I have not correctly formulated my problem.
I want, if I click the check button only the javascript function
(check()) called
.
.
<% form_tag :action=>new %>
<% submit_tag ‘send’ ,:name=>save%>
<% submit_tag ‘check’, :name=>check,:onclick => “check()” %>
<% end %>
when I click on ckeck-button: check() and action are called. But I want,
if I click the check button ONLY the javascript function (check())
called.
Sorry, I know my English is not good. but I hope you understand me…