aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorLawrence Pit <lawrence.pit@gmail.com>2009-03-07 13:29:35 -0600
committerJoshua Peek <josh@joshpeek.com>2009-03-07 13:29:35 -0600
commit77f7d98e38dddf72890c80b4e4b2e088bb76d111 (patch)
treeada19414bebf6c313e3640991a78b97136b99ab3 /actionpack/lib/action_view/helpers
parent45494580d9405e80ba124d17c8379436883c8c78 (diff)
downloadrails-77f7d98e38dddf72890c80b4e4b2e088bb76d111.tar.gz
rails-77f7d98e38dddf72890c80b4e4b2e088bb76d111.tar.bz2
rails-77f7d98e38dddf72890c80b4e4b2e088bb76d111.zip
submit_tag with confirmation and disable_with [#660 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/form_tag_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb
index 4646bc118b..6d39a53adc 100644
--- a/actionpack/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -360,8 +360,8 @@ module ActionView
end
if confirm = options.delete("confirm")
- options["onclick"] ||= ''
- options["onclick"] << "return #{confirm_javascript_function(confirm)};"
+ options["onclick"] ||= 'return true;'
+ options["onclick"] = "if (!#{confirm_javascript_function(confirm)}) return false; #{options['onclick']}"
end
tag :input, { "type" => "submit", "name" => "commit", "value" => value }.update(options.stringify_keys)