Jump to content

must not execute onclick in disabled <a>


Bogey

Recommended Posts

Hi all,

 

I have a button, which needs to be enabled, after some items has been filled in on the page. At startup is it disabled.

In this <a> I have a onclick event, which ONLY must execute, when the <a> has been enabled, but when I use underneath line, than the code even executes when disabled...

 

any sollutions?

<a class="button radius" id='ahrefSendContact' href="javascript:void(0)" disabled='disabled' onclick="test('ahrefSendContact')" title='active when all filled in!'>Send</a>
Link to comment
Share on other sites

The <a> element doesn't have a disabled attribute.

 

You're going to have to change the test() function to check whether or not the element should do something when clicked or not.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...