469,289 Members | 2,207 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,289 developers. It's quick & easy.

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 1900
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

Post your reply

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

Similar topics

2 posts views Thread by Andreas Knollmann | last post: by
2 posts views Thread by Paolo Mancini | last post: by
10 posts views Thread by WindAndWaves | last post: by
5 posts views Thread by csgraham74 | last post: by
7 posts views Thread by Ryan Ternier | last post: by
5 posts views Thread by Stuart Shay | last post: by
1 post views Thread by Frank O'Hara | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.