Code: Select all
function checkForm()
{
var checkCount = 0;
var radios = document.getElementsByTagName('input');
for (var x in radios)
{
if (radios[x].type == 'radio' && radios[x].checked)
{
checkCount++;
}
}
if (checkCount < 19)
{
try {
document.getElementById('nodey').removeChild(submitButton);
} catch (e) {
//
}
}
else
{
try {
document.getElementById('nodey').removeChild(submitButton);
} catch (e) {
//
}
document.getElementById('nodey').appendChild(submitButton);
}
}
Any clues?
Here's how it's being called:
Code: Select all
<div style="float: left; width: 40px; position: relative;"> <input onchange="checkForm();" onclick="checkForm();" type="radio" name="question_10" value="a" /></div>