I have a procedure which clears out any textfields on a web site, but I would like to also do that with checkboxes, I hope somebody can advice what it might be.
I tried document.getElementById('IntakeFormReceived').value =
These values
0 or '' or "" or "off"
Anybody know what I should use
This is the code :
function addParticipant() {
// check if any changes are outstanding
if (!checkChanges()) { return false; }
if (document.getElementById('addbtn').value=="Add Participant") {
// disabled buttons
document.getElementById('addbtn').value="Cancel";
document.getElementById('savebtn').disabled=true;
document.getElementById('savebtn').className="btn1dis";
document.getElementById('prevbtn').disabled=true;
document.getElementById('prevbtn').className="btn2dis";
document.getElementById('nextbtn').disabled=true;
document.getElementById('nextbtn').className="btn3dis";
document.getElementById('searchbtn').disabled=true;
document.getElementById('searchbtn').className="btn4dis";
// empty all text fields and move to tab2
newParticipant = true;
var sels = document.getElementsByTagName('select');
var i;
for (i=0; i<sels.length; i++) {
sels.selectedIndex = 0;
}
var inps = document.getElementsByTagName('input');
for (i=0; i<inps.length; i++) {
if (inps.type=="text") { inps.value = ""; }
}
document.getElementById('Notes').value = "";
document.getElementById('IntakeFormReceived').value = "Off";
showTab(2);
} else {
// re-enable buttons
document.getElementById('addbtn').value="Add Participant";
document.getElementById('searchbtn').disabled=false;
document.getElementById('searchbtn').className="btn4";
newParticipant = false;
showParticipant(curParticipant,true);
}
}
I tried document.getElementById('IntakeFormReceived').value =
These values
0 or '' or "" or "off"
Anybody know what I should use
This is the code :
function addParticipant() {
// check if any changes are outstanding
if (!checkChanges()) { return false; }
if (document.getElementById('addbtn').value=="Add Participant") {
// disabled buttons
document.getElementById('addbtn').value="Cancel";
document.getElementById('savebtn').disabled=true;
document.getElementById('savebtn').className="btn1dis";
document.getElementById('prevbtn').disabled=true;
document.getElementById('prevbtn').className="btn2dis";
document.getElementById('nextbtn').disabled=true;
document.getElementById('nextbtn').className="btn3dis";
document.getElementById('searchbtn').disabled=true;
document.getElementById('searchbtn').className="btn4dis";
// empty all text fields and move to tab2
newParticipant = true;
var sels = document.getElementsByTagName('select');
var i;
for (i=0; i<sels.length; i++) {
sels.selectedIndex = 0;
}
var inps = document.getElementsByTagName('input');
for (i=0; i<inps.length; i++) {
if (inps.type=="text") { inps.value = ""; }
}
document.getElementById('Notes').value = "";
document.getElementById('IntakeFormReceived').value = "Off";
showTab(2);
} else {
// re-enable buttons
document.getElementById('addbtn').value="Add Participant";
document.getElementById('searchbtn').disabled=false;
document.getElementById('searchbtn').className="btn4";
newParticipant = false;
showParticipant(curParticipant,true);
}
}