Jump to content

Disabling Links


Captain825

Recommended Posts

Hi,

 

I am using Dreamweaver CS3.  I would like the links on a page to be disabled until the user clicks on a check box at which time the links would be enabled.  If the user then unchecks the check box, I would like the links to be disabled again.  I would appreciate any help on this.

 

Thanks,

Link to comment
Share on other sites

<input type="checkbox" oncheck="myDisable(this)" />

<a href="" id="link"></a>

 

<script>

 

function myDisable(e){

 

if(e.checked){

 

document.getElementById('link').disabled = true;

 

}

 

}

 

</script>

 

I think that should work, I didn't test it, just wrote.

Link to comment
Share on other sites

Anywho if that's the case hmm.  VB script perhaps?  Or use some type of AJAX technique (though if js is disabled couldn't do it through that I guess.)

 

Or an annoying way would be submit the form when a checkbox is click and refresh the results based on that.  That will stop the JS problem.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.