From 2e30ffd77c201d6ed527506691d5deca83a6ea42 Mon Sep 17 00:00:00 2001 From: "Mark M. Florida" <markflorida@wustl.edu> Date: Tue, 30 Aug 2016 17:09:47 -0500 Subject: [PATCH] XNAT-4491: IE requires 'type' attribute to be set before 'value' for radio buttons --- src/main/webapp/scripts/lib/spawn/spawn.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/webapp/scripts/lib/spawn/spawn.js b/src/main/webapp/scripts/lib/spawn/spawn.js index 4f847fd5..e1502477 100644 --- a/src/main/webapp/scripts/lib/spawn/spawn.js +++ b/src/main/webapp/scripts/lib/spawn/spawn.js @@ -271,6 +271,11 @@ opts = opts || {}; children = children || null; + // make sure [type] attribute is applied FIRST for <input> elements + if (/input/i.test(el.tagName) && opts.type) { + el.type = opts.type; + } + if (!isVoid){ // if 'opts' is a string, // set el's innerHTML and @@ -300,6 +305,7 @@ // IE *REALLY* hates method="PUT" on forms var methodPut = (opts.method && /put/i.test(opts.method)); + ////////////////////////////////////////////////// // add attributes and properties to element forOwn(opts, function(prop, val){ // only add if NOT in 'skip' array @@ -307,6 +313,8 @@ el[prop] = val; } }); + ////////////////////////////////////////////////// + // explicitly add element attributes if (opts.attr){ -- GitLab