T
teddysnips
I'm trying to disable a button in javascript. At some point I want to
do it when a check box is checked, but for testing purposes I'm doing
it on the form submit.
var frm = document.getElementById('Form1');
frm.oldOnSubmit = frm.onsubmit;
frm.onsubmit = function() {fubar(); if (this.oldOnSubmit)
this.oldOnSubmit(); };
// Get document element
function getE(id) {
return document.getElementById(id);
}
function fubar() {
debugger;
var cmd = getE('cmdFilter');
cmd.style.visibility = "hidden";
cmd.disabled ='true';
window.status = "Please wait...";
document.title = window.status;
document.all.item("Form1").style.cursor = "wait";
return;
}
I'm hitting the debugger; breakpoint, but when the code has run the
button "cmdFilter" is unaffected - neither hidden nor disabled.
Help, please!
Thanks
Edward
do it when a check box is checked, but for testing purposes I'm doing
it on the form submit.
var frm = document.getElementById('Form1');
frm.oldOnSubmit = frm.onsubmit;
frm.onsubmit = function() {fubar(); if (this.oldOnSubmit)
this.oldOnSubmit(); };
// Get document element
function getE(id) {
return document.getElementById(id);
}
function fubar() {
debugger;
var cmd = getE('cmdFilter');
cmd.style.visibility = "hidden";
cmd.disabled ='true';
window.status = "Please wait...";
document.title = window.status;
document.all.item("Form1").style.cursor = "wait";
return;
}
I'm hitting the debugger; breakpoint, but when the code has run the
button "cmdFilter" is unaffected - neither hidden nor disabled.
Help, please!
Thanks
Edward