diff options
author | Han Kessels <han.kessels@gmail.com> | 2009-03-27 15:25:27 +0900 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2009-06-01 14:03:52 +1200 |
commit | 9537fd0e3a7625afe4bee75d749647ca1837195a (patch) | |
tree | bf116afaa5c2d68cbf9fe4055e55ec33cac7de70 /actionpack/lib | |
parent | 532219fd091837a9312a301c74e0fbf06abab3a8 (diff) | |
download | rails-9537fd0e3a7625afe4bee75d749647ca1837195a.tar.gz rails-9537fd0e3a7625afe4bee75d749647ca1837195a.tar.bz2 rails-9537fd0e3a7625afe4bee75d749647ca1837195a.zip |
fix for IE incompatibility of :disable_with in submit_tag
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_tag_helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index daf38fe3da..c96b1fc8d2 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -353,7 +353,8 @@ module ActionView disable_with << ";#{options.delete('onclick')}" if options['onclick'] options["onclick"] = "if (window.hiddenCommit) { window.hiddenCommit.setAttribute('value', this.value); }" - options["onclick"] << "else { hiddenCommit = this.cloneNode(false);hiddenCommit.setAttribute('type', 'hidden');this.form.appendChild(hiddenCommit); }" + options["onclick"] << "else { hiddenCommit = document.createElement('input');hiddenCommit.type = 'hidden';" + options["onclick"] << "hiddenCommit.value = this.value;hiddenCommit.name = this.name;this.form.appendChild(hiddenCommit); }" options["onclick"] << "this.setAttribute('originalValue', this.value);this.disabled = true;#{disable_with};" options["onclick"] << "result = (this.form.onsubmit ? (this.form.onsubmit() ? this.form.submit() : false) : this.form.submit());" options["onclick"] << "if (result == false) { this.value = this.getAttribute('originalValue');this.disabled = false; }return result;" |