Help with function to dsable all buttons in HTML doccument

J

James

Hi,

I am trying to write a function that'll disable all buttons in an HTML
doccument once one is clicked and then proceed with the default action of
that button (which maybe a 'submit' type or maybe a 'button' type with code
for onClick).

Here's what i have so far:

// JavaScript include Document
window.onload = function() {
oneClick();
}
// Disable all buttons
function disableButtons() {
var buttons = document.getElementsByTagName("input");
for (var i=0; i < buttons.length; i++) {
if (buttons.getAttribute("type") == "button" ||
buttons.getAttribute("type") == "submit") {
buttons.disabled = true;
}
}
}
// Attach disable all buttons function to all buttons
function oneClick() {
var buttons = document.getElementsByTagName("input");
for (var i=0; i < buttons.length; i++) {
if (buttons.getAttribute("type") == "button" ||
buttons.getAttribute("type") == "submit") {
var oldOnclick = buttons.getAttribute("onClick");
buttons.onclick = function() {
disableButtons();
oldOnclick;
return true;
}
}
}
}

Whilst all the buttons do get disabled in both IE7 and FF2 once one of them
is clicked, neither of the browsers will continue with a 'button' type
button's original onClick event handler's code. Also, a 'submit' type button
doesn't go on to submit the form in IE7 (which seems to work nicely in FF2).

Any help with this would very much appriciated.

Many Thanks
James
 
T

Thomas 'PointedEars' Lahn

James said:
I am trying to write a function that'll disable all buttons in an HTML
doccument once one is clicked and then proceed with the default action of
that button (which maybe a 'submit' type or maybe a 'button' type with code
for onClick).

However, that is as unwise as you posting with an invalid From header.


PointedEars
 
J

James

Thank you for the reply.
However, that is as unwise as you posting with an invalid From header.

I don't think i follow. Could you please explain this for me?

James
 
N

Noah Sussman

buttons.onclick = function() {
disableButtons();
oldOnclick;
return true;
}

neither of the browsers will continue with a 'button' type
button's original onClick event handler's code.


In the code above, you're missing parentheses after the call to
oldOnclick:

oldOnclick();

As to diagnosing the other issues your experiencing, it would be
really helpful if you'd post the HTML you're trying use.
 
J

James

Thank you for the reply
In the code above, you're missing parentheses after the call to
oldOnclick:
oldOnclick();

I've added the parentheses, but both Firebug and MS Script Debugger find an
error with this.
As to diagnosing the other issues your experiencing, it would be
really helpful if you'd post the HTML you're trying use.

Here's a short example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="scripts.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test</title>
</head>
<body>
<form name="form1" method="post" action="someotherpage.asp">
<label for="name">Name:
<input name="name" type="text" id="name">
</label>
<input type="submit" name="submit" id="submit" value="Submit">
</form>
<input name="google" type="button" value="Google" onClick="window.location =
'http://www.google.co.uk';">
</body>
</html>

Many Thanks
James
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>, Thu,
6 Sep 2007 12:46:50 said:
However, that is as unwise as you posting with an invalid From header.

Control freak.

Whilst the traditional assumption here is that code is being written for
the general Web, that assumption should not be presumed to be true.

It could make perfect sense in a diagnostic tool in a psychiatric
laboratory; or as a pedagogic exercise.

KETFOB.
 
J

James

Whilst the traditional assumption here is that code is being written for
the general Web, that assumption should not be presumed to be true.

And in this case that assumption is false - the code is for a tightly
controlled intranet site where all users will be using Internet Explorer,
hence the problem.

Does anyone have any pointers on how to get this to work?

Many Thanks
James
 
P

prowyh

And in this case that assumption is false - the code is for a tightly
controlled intranet site where all users will be using Internet Explorer,
hence the problem.

Does anyone have any pointers on how to get this to work?

Many Thanks
James

oops, some thing wrong in your html and javascript code.

at first, oldOnclick should be oldOnclick();
second, it can navigate to www.google.co.uk when click any of the
buttons, but the form could not be submitted.
in your code:

var oldOnclick = buttons.getAttribute("onClick");
buttons.onclick = function() {
disableButtons();
oldOnclick();
return true;
}

whatever buttons refers to, the oldOnclick always means:
function anonymous() =
{
window.location = 'http://www.google.co.uk';
}

so the page navigates to www.google.co.uk whenever you click any of
the buttons. it's the effect of closure.

i think it is impossible to submit the current page while navigate to
another url simultaneously.
 
J

James

Hi

Thanks for your reply.
oops, some thing wrong in your html and javascript code.
I think so too. I'm not sure that i am explaining what i am trying to
accomplish very well, or maybe not understanding the given answers (both are
more than possable). Let me have another go.

Lets start again.
I have some buttons on a page.
Some are Submit butons (wrapped in a form with other form elements)
Some are 'button' buttons with onClick events defined (these are not wrapped
in a form)
When the user clicks a submit button, I'd like to disable all of the buttons
on the page and have the form submitted. This works as i'd like in FF but
not in IE
When the user clicks a 'button' button, I'd like to disable all of the
buttons on the page and follow the buttons original onClick event. No forms
need submitting. This doesn't work as i'd like i FF or IE.

Here's what I hope is a better short example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="scripts.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test</title>
</head>
<body>
<h1>Products</h1>
<table>
<tr>
<th>id</th>
<th>Name</th>
<th>Action</th>
</tr>
<tr>
<td>1</td>
<td>Widget 1</td>
<td><input name="edit1" type="button" value="Edit"
onClick="window.location = 'poduct_edit.asp?id=1';" id="edit1">
<input name="del1" type="button" value="Delete" onClick="window.location
= 'poduct_delete.asp?id=1';" id="del1"></td>
</tr>
<tr>
<td>2</td>
<td>Widget 2</td>
<td><input name="edit2" type="button" value="Edit"
onClick="window.location = 'poduct_edit.asp?id=2';" id="edit2">
<input name="del2" type="button" value="Delete" onClick="window.location
= 'poduct_delete.asp?id=2';" id="del2"></td>
</tr>
<tr>
<td>3</td>
<td>Widget 3</td>
<td><input name="edit3" type="button" value="Edit"
onClick="window.location = 'poduct_edit.asp?id=3';" id="edit3">
<input name="del3" type="button" value="Delete" onClick="window.location
= 'poduct_delete.asp?id=3';" id="del3"></td>
</tr>
</table>
<h2>Add a Product</h2>
<form name="form1" method="post" action="product_add.asp">
<label for="Name">Name:
<input name="Name" type="text" id="Name">
</label>
<input type="submit" name="submit" id="submit" value="Add">
</form>
</body>
</html>

and the contents of 'scripts.js':

window.onload = function() {
oneClick();
}
// Disable all buttons
function disableButtons() {
var buttons = document.getElementsByTagName("input");
for (var i=0; i < buttons.length; i++) {
if (buttons.getAttribute("type") == "button" ||
buttons.getAttribute("type") == "submit") {
buttons.disabled = true;
}
}
}
// Attach disable all buttons function to all buttons
function oneClick() {
var buttons = document.getElementsByTagName("input");
for (var i=0; i < buttons.length; i++) {
if (buttons.getAttribute("type") == "button" ||
buttons.getAttribute("type") == "submit") {
var oldOnclick = buttons.getAttribute("onClick");
buttons.onclick = function() {
disableButtons();
oldOnclick;
return true;
}
}
}
}

Any suggestions?

Thanks for bearing with me.
James
 
T

Tim Ferguson

When the user clicks a 'button' button, I'd like to disable all of the
buttons on the page and follow the buttons original onClick event. No
forms need submitting. This doesn't work as i'd like i FF or IE.

As far as I can see, all the button functions seem to be writing to the
window.location property, so whatever you do to the other buttons, they are
all going to disappear when the new page is loaded. Perhaps if you look
pretty closely you might see them disabled before they vanish.

Isn't this a problem for the server-side scripting, to disable the buttons
in the html of the new page as it is served?

Tim F
 
J

James

Thanks for your reply.
As far as I can see, all the button functions seem to be writing to the
window.location property, so whatever you do to the other buttons, they
are
all going to disappear when the new page is loaded. Perhaps if you look
pretty closely you might see them disabled before they vanish.

That's pretty much what i'm trying to achieve. The thinking is my target
users are a bit trigger happy with the mouse; if i can limit them to
clicking a button once, then maybe i can avoid double entry in the
intranet's underlying database by stopping them from calling a page which
alters the database's contents more than once in their impatience.
Isn't this a problem for the server-side scripting, to disable the buttons
in the html of the new page as it is served?

It's not my intention to disable buttons on the new page (whether it is a
different page or the same page) - just to disable buttons on the current
page before the new page loads. I don't think my script is disabling buttons
on the new page, though it would indeed be a problem (at least from a
usability point of view)

Many Thanks
James
 
J

James

Hi,

Following the helpfull responses to my original post to this ng I've
re-worked my functions that are meant to disable all buttons in an HTML
doccument once clicking one of them and then proceeding to execute the
buttons original action. It's working perfectly in FF, but unfortunately not
in IE. I've found that with the test page (who's code is below), the line
var oldOnClick = this.getAttribute("onClick"); fills the variable oldOnClick
with a string that consists of a javascript command (typically something
like "window.location = 'my_page.htm';", which is what I want it to do)
whereas in IE, the variable is filled with a function which is the
variable's parent annoymous function:

Can anyone suggest how i go about ensuring that the variable oldOnClick is
filled with the clicked button's onClick value rather than the function that
encapultes the variable declaration?

Many Thanks
James

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
<!--
window.onload = function() {
oneClick();
}

function GoToDelete(url) {
var confirmresp = confirm('Are you sure?');
if (confirmresp) {
window.location = url;
}
}

function extractString(strg, delim) {
var bpos, epos, res;
epos = strg.lastIndexOf(delim);
bpos = strg.lastIndexOf(delim, (epos - 1));
res = strg.substring((bpos + 1), epos);
return res;
}

function disableButtons() {
var buttons = document.getElementsByTagName("input");
for (var i=0; i < buttons.length; i++) {
if (buttons.getAttribute("type") == "button" ||
buttons.getAttribute("type") == "submit") {
buttons.disabled = true;
}
}
}

function oneClick() {
var buttons = document.getElementsByTagName("input");
for (var i = 0; i < buttons.length; i++) {
if (buttons.getAttribute("type") == "button" ||
buttons.getAttribute("type") == "submit") {
buttons.onclick = function() {
var oldOnClick = this.getAttribute("onClick");
disableButtons();
alert(oldOnClick);
alert(typeof(oldOnClick));
if (oldOnClick) {
var page = extractString(oldOnClick, "'");
if (oldOnClick.indexOf("window.location = ") > -1) {
window.location = page;
} else if (oldOnClick.indexOf("GoToDelete") > -1) {
GoToDelete(page);
}
}
return true;
}
}
}
}
-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test</title>
</head>
<body>
<h1>Products</h1>
<h2>Add a Product</h2>
<form name="form1" method="post" action="product_add.asp">
<label for="Name">Name:
<input name="Name" type="text" id="Name">
</label>
<input type="submit" name="submit" id="submit" value="Add">
</form>
<table>
<tr>
<th>id</th>
<th>Name</th>
<th>Action</th>
</tr>
<tr>
<td>1</td>
<td>Widget 1</td>
<td><input name="edit1" type="button" value="Edit"
onClick="window.location = 'product_edit.asp?id=1';" id="edit1">
<input name="del1" type="button" value="Delete"
onClick="GoToDelete('product_delete.asp?id=1');" id="del1"></td>
</tr>
<tr>
<td>2</td>
<td>Widget 2</td>
<td><input name="edit2" type="button" value="Edit"
onClick="window.location = 'product_edit.asp?id=2';" id="edit2">
<input name="del2" type="button" value="Delete"
onClick="GoToDelete('product_delete.asp?id=2');" id="del2"></td>
</tr>
<tr>
<td>3</td>
<td>Widget 3</td>
<td><input name="edit3" type="button" value="Edit"
onClick="window.location = 'product_edit.asp?id=3';" id="edit3">
<input name="del3" type="button" value="Delete"
onClick="GoToDelete('product_delete.asp?id=3');" id="del3"></td>
</tr>
</table>

</body>
</html>
 
C

Captain Paralytic

Hi,

Following the helpfull responses to my original post to this ng I've
re-worked my functions that are meant to disable all buttons in an HTML
doccument once clicking one of them and then proceeding to execute the
buttons original action. It's working perfectly in FF, but unfortunately not
in IE. I've found that with the test page (who's code is below), the line
var oldOnClick = this.getAttribute("onClick"); fills the variable oldOnClick
with a string that consists of a javascript command (typically something
like "window.location = 'my_page.htm';", which is what I want it to do)
whereas in IE, the variable is filled with a function which is the
variable's parent annoymous function:

Can anyone suggest how i go about ensuring that the variable oldOnClick is
filled with the clicked button's onClick value rather than the function that
encapultes the variable declaration?

Many Thanks
James

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
<!--
window.onload = function() {
oneClick();

}

function GoToDelete(url) {
var confirmresp = confirm('Are you sure?');
if (confirmresp) {
window.location = url;
}

}

function extractString(strg, delim) {
var bpos, epos, res;
epos = strg.lastIndexOf(delim);
bpos = strg.lastIndexOf(delim, (epos - 1));
res = strg.substring((bpos + 1), epos);
return res;

}

function disableButtons() {
var buttons = document.getElementsByTagName("input");
for (var i=0; i < buttons.length; i++) {
if (buttons.getAttribute("type") == "button" ||
buttons.getAttribute("type") == "submit") {
buttons.disabled = true;
}
}

}

function oneClick() {
var buttons = document.getElementsByTagName("input");
for (var i = 0; i < buttons.length; i++) {
if (buttons.getAttribute("type") == "button" ||
buttons.getAttribute("type") == "submit") {
buttons.onclick = function() {
var oldOnClick = this.getAttribute("onClick");
disableButtons();
alert(oldOnClick);
alert(typeof(oldOnClick));
if (oldOnClick) {
var page = extractString(oldOnClick, "'");
if (oldOnClick.indexOf("window.location = ") > -1) {
window.location = page;
} else if (oldOnClick.indexOf("GoToDelete") > -1) {
GoToDelete(page);
}
}
return true;
}
}
}}

-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test</title>
</head>
<body>
<h1>Products</h1>
<h2>Add a Product</h2>
<form name="form1" method="post" action="product_add.asp">
<label for="Name">Name:
<input name="Name" type="text" id="Name">
</label>
<input type="submit" name="submit" id="submit" value="Add">
</form>
<table>
<tr>
<th>id</th>
<th>Name</th>
<th>Action</th>
</tr>
<tr>
<td>1</td>
<td>Widget 1</td>
<td><input name="edit1" type="button" value="Edit"
onClick="window.location = 'product_edit.asp?id=1';" id="edit1">
<input name="del1" type="button" value="Delete"
onClick="GoToDelete('product_delete.asp?id=1');" id="del1"></td>
</tr>
<tr>
<td>2</td>
<td>Widget 2</td>
<td><input name="edit2" type="button" value="Edit"
onClick="window.location = 'product_edit.asp?id=2';" id="edit2">
<input name="del2" type="button" value="Delete"
onClick="GoToDelete('product_delete.asp?id=2');" id="del2"></td>
</tr>
<tr>
<td>3</td>
<td>Widget 3</td>
<td><input name="edit3" type="button" value="Edit"
onClick="window.location = 'product_edit.asp?id=3';" id="edit3">
<input name="del3" type="button" value="Delete"
onClick="GoToDelete('product_delete.asp?id=3');" id="del3"></td>
</tr>
</table>

</body>
</html>


How about covering the whole page with a transparent DIV, effectively
protecting the buttons from being pressed?
 
D

David Mark

Hi,

Following the helpfull responses to my original post to this ng I've
re-worked my functions that are meant to disable all buttons in an HTML
doccument once clicking one of them and then proceeding to execute the
buttons original action. It's working perfectly in FF, but unfortunately not
in IE. I've found that with the test page

That's because getAttribute is broken in IE.

(who's code is below), the line
var oldOnClick = this.getAttribute("onClick"); fills the variable oldOnClick
with a string that consists of a javascript command (typically something
like "window.location = 'my_page.htm';", which is what I want it to do)
whereas in IE, the variable is filled with a function which is the
variable's parent annoymous function:

Right. IE thinks attributes and properties are the same thing.
Can anyone suggest how i go about ensuring that the variable oldOnClick is
filled with the clicked button's onClick value rather than the function that
encapultes the variable declaration?

Why would you want the string?
Many Thanks
James

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
<!--
window.onload = function() {
oneClick();

}

function GoToDelete(url) {
var confirmresp = confirm('Are you sure?');
if (confirmresp) {
window.location = url;
}

}

function extractString(strg, delim) {
var bpos, epos, res;
epos = strg.lastIndexOf(delim);
bpos = strg.lastIndexOf(delim, (epos - 1));
res = strg.substring((bpos + 1), epos);
return res;

}

function disableButtons() {
var buttons = document.getElementsByTagName("input");
for (var i=0; i < buttons.length; i++) {
if (buttons.getAttribute("type") == "button" ||
buttons.getAttribute("type") == "submit") {
buttons.disabled = true;
}
}

}

function oneClick() {
var buttons = document.getElementsByTagName("input");
for (var i = 0; i < buttons.length; i++) {
if (buttons.getAttribute("type") == "button" ||
buttons.getAttribute("type") == "submit") {
buttons.onclick = function() {
var oldOnClick = this.getAttribute("onClick");
disableButtons();
alert(oldOnClick);
alert(typeof(oldOnClick));
if (oldOnClick) {
var page = extractString(oldOnClick, "'");
if (oldOnClick.indexOf("window.location = ") > -1) {
window.location = page;
} else if (oldOnClick.indexOf("GoToDelete") > -1) {
GoToDelete(page);
}
}
return true;
}


This is ridiculous. Why not use the function that is available to you
(in the onclick property), rather than trying to get the attribute and
interpret it?

Something like:

var oldOnClick = buttons.onclick;
buttons.onclick = (function(o) { return function(e)
{ disableButtons(); oldOnClick(); }; })(oldOnClick);
 
J

James

Thanks for your response.
How about covering the whole page with a transparent DIV, effectively
protecting the buttons from being pressed?

Unfortunately that won't solve my problem - the code that disables the
buttons already works (though your suggestion would probably work well too).

Thanks
James
 
D

David Mark

[snip]
How about covering the whole page with a transparent DIV, effectively
protecting the buttons from being pressed?- Hide quoted text -
Though a popular "solution" for modality, it isn't particularly
effective when you consider keyboard input.
 
J

James

Thanks for your response.
That's because getAttribute is broken in IE.

I didn't know that. As a quick test I changed:

var oldOnClick = this.getAttribute("onClick");
to
var oldOnClick = this.onclick;

But then oldOnClick gets filled with a function in both IE and FF.
Why would you want the string?

I don't particularly need the string - I just need to execute the clicked
buttons inline action (if it exixts) after disabling the buttons. I've ended
up with this code as a result of tying to get the function to work with my
limited knowledge.
This is ridiculous. Why not use the function that is available to you
(in the onclick property), rather than trying to get the attribute and
interpret it?

Something like:

var oldOnClick = buttons.onclick;
buttons.onclick = (function(o) { return function(e)
{ disableButtons(); oldOnClick(); }; })(oldOnClick);


I've updated the oneClick function with your suggestion, but now its doesn't
matter which one of the buttons I click, it always the last buttons inline
onClick rather than the clicked ones. Have I implemented your suggestion
wrong:

function oneClick() {
var buttons = document.getElementsByTagName("input");
for (var i = 0; i < buttons.length; i++) {
if (buttons.getAttribute("type") == "button" ||
buttons.getAttribute("type") == "submit") {
var oldOnClick = buttons.onclick;
buttons.onclick = (function(o) { return function(e)
{ disableButtons(); oldOnClick(); }; })(oldOnClick);
}
}
}

Many Thanks
James
 
D

David Mark

Thanks for your response.
That's because getAttribute is broken in IE.

I didn't know that. As a quick test I changed:

var oldOnClick = this.getAttribute("onClick");
to
var oldOnClick = this.onclick;

But then oldOnClick gets filled with a function in both IE and FF.
Why would you want the string?

I don't particularly need the string - I just need to execute the clicked
buttons inline action (if it exixts) after disabling the buttons. I've ended
up with this code as a result of tying to get the function to work with my
limited knowledge.
This is ridiculous. Why not use the function that is available to you
(in the onclick property), rather than trying to get the attribute and
interpret it?
Something like:
var oldOnClick = buttons.onclick;
buttons.onclick = (function(o) { return function(e)
{ disableButtons(); oldOnClick(); }; })(oldOnClick);


I've updated the oneClick function with your suggestion, but now its doesn't
matter which one of the buttons I click, it always the last buttons inline
onClick rather than the clicked ones. Have I implemented your suggestion
wrong:


No, I typed it wrong. The oldOnClick() inside the closure should be
o();
function oneClick() {
var buttons = document.getElementsByTagName("input");
for (var i = 0; i < buttons.length; i++) {
if (buttons.getAttribute("type") == "button" ||
buttons.getAttribute("type") == "submit") {
var oldOnClick = buttons.onclick;
buttons.onclick = (function(o) { return function(e)
{ disableButtons(); oldOnClick(); }; })(oldOnClick);
}
}

}

Many Thanks
James
 
D

David Mark

Thanks for your response.
That's because getAttribute is broken in IE.

I didn't know that. As a quick test I changed:

var oldOnClick = this.getAttribute("onClick");
to
var oldOnClick = this.onclick;

But then oldOnClick gets filled with a function in both IE and FF.
Why would you want the string?

I don't particularly need the string - I just need to execute the clicked
buttons inline action (if it exixts) after disabling the buttons. I've ended
up with this code as a result of tying to get the function to work with my
limited knowledge.
This is ridiculous. Why not use the function that is available to you
(in the onclick property), rather than trying to get the attribute and
interpret it?
Something like:
var oldOnClick = buttons.onclick;
buttons.onclick = (function(o) { return function(e)
{ disableButtons(); oldOnClick(); }; })(oldOnClick);


I've updated the oneClick function with your suggestion, but now its doesn't
matter which one of the buttons I click, it always the last buttons inline
onClick rather than the clicked ones. Have I implemented your suggestion
wrong:

function oneClick() {
var buttons = document.getElementsByTagName("input");
for (var i = 0; i < buttons.length; i++) {
if (buttons.getAttribute("type") == "button" ||
buttons.getAttribute("type") == "submit") {
var oldOnClick = buttons.onclick;
buttons.onclick = (function(o) { return function(e)
{ disableButtons(); oldOnClick(); }; })(oldOnClick);
}
}

}

Many Thanks
James


And set buttons to null before you exit that function or you will leak
memory in IE.
 
J

James

It is so close to working now - I can't thank you enough for the time and
effort you have put in to helping me with this. Could I just ask one or two
more questions?

IE and FF are both telling me that I'm missing a closing parenthesis but I
can't work out where in { disableButtons(); oldOnClick(); }; })(o();); it
should be - can you help?

function oneClick() {
var buttons = document.getElementsByTagName("input");
for (var i = 0; i < buttons.length; i++) {
if (buttons.getAttribute("type") == "button" ||
buttons.getAttribute("type") == "submit") {
var oldOnClick = buttons.onclick;
buttons.onclick = (function(o) { return function(e)
{ disableButtons(); oldOnClick(); }; })(o(););
}
}
buttons = null;
}

Also, some of the button's onClick's call a function called GoToDelete, but
when I click one of these I get an error 'GoToDelete is not defined' even
though it is (it's in the document before the oneClick function) - what am I
doing wrong here?

Finally, since you have introduced to me some concepts that I have never
seen, perhaps you could recommend a good book on the subject ;-)
And set buttons to null before you exit that function or you will leak
memory in IE.

Thanks for that, I think I have it in the right place.

Many Thanks
James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,154
Messages
2,570,870
Members
47,400
Latest member
FloridaFvt

Latest Threads

Top