Can I disable a checkbox, when clicking on another checkbox?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Can I disable a checkbox, when clicking on another checkbox?

Post by simonmlewis »

We need to enable a homepage to state if it's banner "expands". However, we also want the admin to be able to tick a box to say if it will appear on the mobile homepage.

Expanding ones won't work on mobile.

So I want it if they click the "expanding" checkbox, then the "mobile" checkbox becomes disabled.

I'm sure it's some form of onclick, but it would need perhaps to work for multiple ones, as there are lots of banners that will need this on the one page.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Can I disable a checkbox, when clicking on another check

Post by simonmlewis »

While I am in this code, why is this code causing the box to jump all over the place onmouseover?
It should just expand the box. It flickers with no control at all.

I could do it with a table which works flawlessly, but that's a lot of unnecessary code.

Code: Select all

<div class='home_widebanner' style='background-image: url(/images/pages/25415test.jpg);'>
<a href='/home'><img src='/images/homepagemask.png' border='0' height='188px' name='wide_620' 
onmouseover="wide_620.height='550';"
onmouseout="wide_620.height='188';"></a>
</div>
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply