473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Skip or cancel onclick event in FF

Hi,
I have linkbutton with JS validations on onclick event. I need cancel or skip this event dinamically on the client. I cant rewrite logic of this linkbutton. I need disable this event which depend on some conditions from another elements on the page(dropdown, textbox...).

I need something like this.
Example:
function fired from other element, not from linkbutton.

Expand|Select|Wrap|Line Numbers
  1. function someFce(linkButtonID)
  2. {
  3. var linkButton = document.getElementById(linkButtonID);
  4.  
  5. if (//firefox//)
  6. {
  7.     if (//something//)
  8.     {
  9.        //desible linkbutton onclick event//
  10.     }
  11.     else
  12.     {
  13.        //enable linkbutton onclick event//
  14.     }
  15. }
  16.  
Where is //desible linkbutton onclick event// and //enable linkbutton onclick event// I need help with the code. Thanks
Sorry my bad english
Sep 30 '11 #1
1 2020
johny10151981
1,059 1GB
follow this example
Expand|Select|Wrap|Line Numbers
  1. <script >
  2. function validation_function()
  3. {
  4.  return false; // it wont switch anymore
  5. }
  6. </script >
  7. <a href='javascript:return validation_function()'>link</a>
  8.  
or
Expand|Select|Wrap|Line Numbers
  1. function validation_function()
  2. {
  3.  if(condition support)
  4.    window.location="http://desired.location.com"
  5.  else
  6.   return;
  7. }
  8. </script >
  9. <a onclick='validation_function()'>link</a>
  10.  
  11.  
Oct 3 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
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...
2
by: Paolo Mancini | last post by:
Hi all, I have a page with many different elements: <a href="...."> ... </a>, listboxes, radiobuttons, etc. Can I use javascript to prevent the user from interacting with the page? That is:...
10
by: WindAndWaves | last post by:
Hi Gurus I have the following code: function CI(ImgN, Alt){ if( document.getElementById && document.getElementById('il') ){ var d=document.getElementById('il');
17
by: abs | last post by:
My element: <span onclick="alert('test')" id="mySpan">test</span> Let's say that I don't know what is in this span's onclick event. Is it possible to add another action to this element's onclick...
2
by: bbcrock | last post by:
I created a "cancel" button for my form at the clients' request, I accidentally copied a submit button and added an OnClick event- a very simple javascript.history function. It did not appear to...
5
by: csgraham74 | last post by:
Basically i have a piece of javascript that calls a function to call a confirm box on screen. onclick= if(sub_ProceedMsg()){} basically what i want to do is to stop the serverside event from...
7
by: Ryan Ternier | last post by:
I have a check box on my page. When a user clicks this box I have a confirmation box come up. When the user clicks OK, true is returned, otherwise false. Now, when true is Returened, I want...
5
by: Stuart Shay | last post by:
Hello All I am working on ASP.NET 1.1 Custom Pager that allows a User to Enter a Number in a TextBox and go to the page selected. Since the OnClick Event does not work in ASP.NET 1.1 for a...
1
by: Frank O'Hara | last post by:
I think I'm losing my mind, granted it is kind of late here so... I'm trying to do some simple validation on the client as keys are pressed. The validation routine works well enough however I...
0
by: stimul8d | last post by:
Before i get flamed, this isn't the usual question you see left right and center. I'm dynamically creating usercontrols inside the page_init event and setting the ID's of each control so that the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...

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.