feat(benchpress): add getStringParameter method to support text and radio inputs

This commit is contained in:
Jeff Cross
2015-01-15 10:51:47 -08:00
parent 39977bd3c2
commit a2b58202a0
2 changed files with 26 additions and 4 deletions

View File

@ -7,8 +7,14 @@
var name = match[1];
var value = match[2];
var els = document.querySelectorAll('input[name="'+name+'"]');
var el;
for (var i=0; i<els.length; i++) {
els[i].value = value;
el = els[i];
if (el.type === 'radio' || el.type === 'checkbox') {
el.checked = el.value === value;
} else {
el.value = value;
}
}
}
})();