snakeeyes1978
Programmer
I have a problem with the following code. It keeps coming back saying - "Error: 'Ballarat' is undefined. When the function is triggered. When I view the source, however, Ballarat is clearly defined.
Any ideas?
function select_all() {
if (document.SWorks.All.checked == true) {
blah = Ballarat;
document.getElementById(blah).checked = true;
} else {
blah = Ballarat;
document.SWorks.getElementById(blah).checked = false;
}
<INPUT type='checkbox' id='Ballarat' name='{16604C2B-FFAF-49F9-A583-EF33C3956D22}'>
<INPUT type='checkbox' name='All' onclick="select_all()"> All</input>
Any ideas?
function select_all() {
if (document.SWorks.All.checked == true) {
blah = Ballarat;
document.getElementById(blah).checked = true;
} else {
blah = Ballarat;
document.SWorks.getElementById(blah).checked = false;
}
<INPUT type='checkbox' id='Ballarat' name='{16604C2B-FFAF-49F9-A583-EF33C3956D22}'>
<INPUT type='checkbox' name='All' onclick="select_all()"> All</input>