On Wed, 2013-10-09 at 16:32 -0500, Tyler Sweet wrote:
> We've been slowly moving from an outdated ticket system to Request
> Tracker, and were pleased that it worked just fine in IE, Chrome, and
> Firefox. We've updated RT to 4.2.0 just recently and noticed that when
> trying to update a ticket, it no longer works in IE. Clicking the
> "Update Ticket" button only reloads the page. We've also seen this odd
> behavior on the search page, clicking "Add these terms and Search"
> simply reloads the page (However does add the terms to the current
> search, it just won't switch to the results page).

Try the attached patch, which will be in 4.2.1.
 - Alex
>From e8277894b339bf12dce1ca1f8b6d5a8fb5eb20de Mon Sep 17 00:00:00 2001
From: Alex Vandiver <ale...@bestpractical.com>
Date: Fri, 11 Oct 2013 15:14:46 -0400
Subject: [PATCH] Insert hidden name=value input after button, not inside of it

jQuery's .append() method inserts the given node within each element,
after all other elements contained within it.  This means that
$this.append( jQuery('<input/>', ... )) effectively attempts to produce:

  <input type="submit">
    <input type="hidden" />
  </input>

Most browsers correctly interpreted this somewhat bogus jQuery
modification, and included the new hidden form element in the
submission; IE9 and IE10 do not.  As such, many pages failed to update
when the submit button was pressed, as the button's value was not seen
on the new page load.

Use .after(), which correctly appends the value after the existing
element, not within it.
---
 share/static/js/forms.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/static/js/forms.js b/share/static/js/forms.js
index 1b6fa9a..57132be 100644
--- a/share/static/js/forms.js
+++ b/share/static/js/forms.js
@@ -7,7 +7,7 @@ jQuery(function() {
     var $this = jQuery(this);
     var name = $this.attr('name');
     if (!name) { return true; }
-    $this.append( jQuery('<input/>', {type: "hidden", name: name, value: $this.val()} ) );
+    $this.after( jQuery('<input/>', {type: "hidden", name: name, value: $this.val()} ) );
     return true;
   })
 });
\ No newline at end of file
-- 
1.8.4

Reply via email to