Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to disable onclick function for all table

Status
Not open for further replies.

botatun

Programmer
Mar 7, 2006
40
US
I have a table with onclick="myfunction()" in several cells.
Is it any function that may disable onclick features for all table?
 
you can write something that will do this, there is no one function, however. you will most likely need to loop through each table element and set it's onclick event to "return false;".

or, you could disable javascript.



*cLFlaVA
----------------------------
[tt]( <P> <B>)13 * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
As a followup to cLFlaVA's suggestion about disabling scripting... this might just work - although I've never tried it.

Put all your onclick-related code in a stand-alone script block with an id, and then when you want to disable the onclick code from running, change the "type" attribute of that code block to some made-up language using getElementById.

As I say, thus is an untested hunch... but you never know!

Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top