473,799 Members | 2,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I disable onclick event of one cell?

Hello,

I've got a table row with an onClick event that loads page1.
Now I do not want to apply this event to one cell of that row because
that cell contains already a link to another page. How do I disable
the onClick event on that one cell? Code:

<table>
<tr onClick="window .location=page1 .html'>
<td></td>
<td></td>
<td></td>
<td></td>
<td><a href="page2.htm l"></td>
</tr>
</table>

Thnx,

Barton
Jul 20 '05 #1
2 11277


Barton wrote:
I've got a table row with an onClick event that loads page1.
Now I do not want to apply this event to one cell of that row because
that cell contains already a link to another page. How do I disable
the onClick event on that one cell? Code:

<table>
<tr onClick="window .location=page1 .html'>
<td></td>
<td></td>
<td></td>
<td></td>
<td><a href="page2.htm l"></td>


Try
<a onclick="if (event.stopProp agation) {
event.stopPropa gation;
}
event.cancelBub ble = true;
return true;"
href="page2.htm l">link</a>

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
Martin Honnen <ma*******@yaho o.de> writes:
<a onclick="if (event.stopProp agation) {
event.stopPropa gation;


Should be: event.stopPropa gation();

Otherwise I agree completely.
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
17082
by: MEM | last post by:
hello, I'd like to 'disable' an image link based on a value selected in a drop down. I currently have an image link that has the onclick event set to execute a function. For example:
2
7032
by: Andreas Knollmann | last post by:
Hi, I create an object like this: var cell = document.createElement("td"). It doesn't have to be cell. I want this cell to use the onclick event. What doesn't work in the IE as well as with Mozilla is: cell.onclick = "whatever()";
3
3171
by: Jeff | last post by:
I have a payment form with a submit button. A large percentage of users double-click the submit button thus submitting their payment information twice. I would like to use javascript to disable the submit button once it's been clicked, yet still have the form submit. I can do this in ASP 2.0, however, ASP.Net seems to be adversely affected if you disable the submit button. Here's how I have it set up... The submit button is a...
4
3126
by: Chris | last post by:
I have an asp.net page say page1.aspx. The form in html code is <form id = "Form1"> And i want to disable all the fields of the form after some code steps. I had created a javascript funct: function disable() { alert("Forms length is :" + Form1.length); for (i = 0; i < Form1.length; i++) { var formElement = Form1.elements;
5
3311
by: Sehboo | last post by:
In my application, there are lot of processes which take several seconds. What we want is that once user clicks on a button (or link or whatever) and while we are processing that request, we don't want user to do anything else on the page. We want to disable everything. I have following javascript on all of my pages (which is supposed to work), but it doesn't work. <script language="JavaScript"> function ignoreinput() { return false;
2
2830
by: =?Utf-8?B?Uml0YUc=?= | last post by:
I posted this question in the C# discussion group but am posting it here also since ASP is involved. I'm new to C# and need some help regarding an onClick event not firing. I have a data grid that I add a cell to programatically. The cell is a hyperlink and the onClick is set to _doPostBack. In my code I handle the event but when I click on that added hyperlink nothing happens. Here's my code (I'll just show the relevant stuff).
18
3943
by: joaotsetsemoita | last post by:
Hello everyone, I'm having troubles assigning an onclick event to a cell. Im trying something like cursorPoint.cells.style.cursor = "hand"; cursorPoint.cells.width = "20"; cursorPoint.cells.onclick = "alert('this is a test');" cursorPoint.cells.alt = "Select the columns"; cursorPoint.cells.innerHTML = "&nbsp;"
5
1882
by: Geoff Cox | last post by:
Hello I have for example <IMG alt="image" id="IMG1" src="../images/play1.gif" onClick="getSound(this);"> Can I disable this (stop onlick from working) until another action has been completed?
8
4150
by: Arhaus | last post by:
I was wondering if someone could help me out. I am new to jscript and I need to modify a calendar onclick event. We have a calendar which displays the dates either in green or red based upon data from a string variable: Valiable example: var t = tDate; tDate = "4/10/2009,4/24/2009,5/8/2009,5/22/2009" The code is written to find a date in the tDate string, then the day number is Green or Red. My question is that the jscript makes all...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10269
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.