Skip to content
Snippets Groups Projects
Commit 2e30ffd7 authored by Mark M. Florida's avatar Mark M. Florida
Browse files

XNAT-4491: IE requires 'type' attribute to be set before 'value' for radio buttons

parent 0299f776
No related branches found
No related tags found
No related merge requests found
...@@ -271,6 +271,11 @@ ...@@ -271,6 +271,11 @@
opts = opts || {}; opts = opts || {};
children = children || null; 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 (!isVoid){
// if 'opts' is a string, // if 'opts' is a string,
// set el's innerHTML and // set el's innerHTML and
...@@ -300,6 +305,7 @@ ...@@ -300,6 +305,7 @@
// IE *REALLY* hates method="PUT" on forms // IE *REALLY* hates method="PUT" on forms
var methodPut = (opts.method && /put/i.test(opts.method)); var methodPut = (opts.method && /put/i.test(opts.method));
//////////////////////////////////////////////////
// add attributes and properties to element // add attributes and properties to element
forOwn(opts, function(prop, val){ forOwn(opts, function(prop, val){
// only add if NOT in 'skip' array // only add if NOT in 'skip' array
...@@ -307,6 +313,8 @@ ...@@ -307,6 +313,8 @@
el[prop] = val; el[prop] = val;
} }
}); });
//////////////////////////////////////////////////
// explicitly add element attributes // explicitly add element attributes
if (opts.attr){ if (opts.attr){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment