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

XNAT-4311: CHECKBOXES

parent 19a6303f
No related branches found
No related tags found
No related merge requests found
...@@ -240,7 +240,7 @@ var XNAT = getObject(XNAT); ...@@ -240,7 +240,7 @@ var XNAT = getObject(XNAT);
// check buttons if value is true // check buttons if value is true
if (/checkbox|radio/i.test(element.type||'')) { if (/checkbox|radio/i.test(element.type||'')) {
element.checked = /true|checked/i.test((opts.checked || element.value).toString()); element.checked = /true|checked/i.test((opts.checked||element.value||'').toString());
// add a hidden input to capture the checkbox/radio value // add a hidden input to capture the checkbox/radio value
hiddenInput = spawn('input', { hiddenInput = spawn('input', {
...@@ -251,12 +251,15 @@ var XNAT = getObject(XNAT); ...@@ -251,12 +251,15 @@ var XNAT = getObject(XNAT);
// change the value of the hidden input onclick // change the value of the hidden input onclick
element.onclick = function(){ element.onclick = function(){
hiddenInput.value = this.checked.toString(); element.value = hiddenInput.value = this.checked.toString();
}; };
// copy name to title
element.title = element.name;
// remove name of checkbox/radio to avoid conflicts // remove name of checkbox/radio to avoid conflicts
element.name = ''; element.name = '';
// add a class for easy selection // add a class for easy selection
addClassName(element, 'controller'); addClassName(element, 'controller');
......
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