infodigger
asked on
Javascript checkboxes selection
Hi,
I have a page with several checkboxes. I need to do the following two things:
1. Add a drop down with options: select all, select none and select based on a hidden value
2. Have two links that can be activated/clicked only when at least one checkbox is selected.
Thank you for your time,
John
I have a page with several checkboxes. I need to do the following two things:
1. Add a drop down with options: select all, select none and select based on a hidden value
2. Have two links that can be activated/clicked only when at least one checkbox is selected.
Thank you for your time,
John
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much for your answers.
I have already implemented the code that sinoj provided and it works except for the part that I want to totally disable the links (actually make them not appear as links, maybe with a style change). So I believe it's fair to give sinoj most of the point.
Thanks,
John
I have already implemented the code that sinoj provided and it works except for the part that I want to totally disable the links (actually make them not appear as links, maybe with a style change). So I believe it's fair to give sinoj most of the point.
Thanks,
John
sinoj, the only thing wrong with your post is that it did not exist when I read the question.
ASKER
Is there a way to change the style when the link is disabled?
Thanks,
John
Thanks,
John
You can do anything with the style, like changing the color to red for disabled and white for enabled:
document.getElementById('I dOfTheFirs tLink').di sabled = disabled;
document.getElementById('I dOfTheFirs tLink').st yle.color = disabled ? '#f00' : '#fff';
document.getElementById('I
document.getElementById('I
ASKER
Thanks:)
hmm... This time I am late :)
What is wrong with my post? and yes it is tested too.