Hi All,
I’m trying to hide a button once someone clicks on it so they can’t keep clicking on it. Below is my code. At the beginning of the code I’m checking for form validations in the else is where I’m trying to make my button hidden.
<script language=”JavaScript”>
function checkAdminFields(){
missinginfo = “”;
if (document.form.field90.value == “”){
missinginfo += “n – Processed By”;
}
if (document.form.field91.value == “”){
missinginfo += “n – Issue Date”;
}
if (document.form.field92.value == “”){
missinginfo += “n – Fee Amount”;
}
if (document.form.field93.value == “”){
missinginfo += “n – Permit No.”;
}
if (missinginfo != “”) {
missinginfo =”_____________________________________n” +
“You failed to correctly fill in your:n” +
missinginfo + “n
“nPlease enter the missing data and submit again!”;
alert(missinginfo);
return false;
}
else {
document.form.approve.style.visibility = ‘invisible’;
return true;
}
}
</script>
Every time I hit the Approve button I keep getting a javascript error of: “Could not get the invisibility property. Invalid argument.”
Does anyone know why I keep getting this?
Here’s my code on my page where I’m calling my function:
<input type=”submit” value=”Approve” name=”approve” onclick=”return checkAdminFields();”>
Thanks in advance for your help.
Kelly