Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

enable/ disable!!

Status
Not open for further replies.

jstar7

Programmer
Dec 17, 2002
61
GB
Hi there,

I have a couple of radio buttons. The two values are Table and Chart. Now when the user clicks on Chart I want to enable another three radio buttons beneth it. I have written code that does this. But when the user clicks back on Table the three buttons stay enabled instead of becoming disabled...heres the code....any ideas?

function Enableoptions() {

if (document.reporter.chartcontent[0].disabled = true) {
document.reporter.chartcontent[0].disabled = false;
document.reporter.chartcontent[1].disabled = false;
document.reporter.chartcontent[2].disabled = false;
}
if (document.reporter.chartcontent[0].disabled = false) {
document.reporter.chartcontent[0].disabled = true;
document.reporter.chartcontent[1].disabled = true;
document.reporter.chartcontent[2].disabled = true;
}

} -------------------------------------
...what rhymes with month?
 
Whoopsie here. Use

Code:
function Enableoptions() {

    if (document.reporter.chartcontent[0].disabled == true) {
        document.reporter.chartcontent[0].disabled = false;
        document.reporter.chartcontent[1].disabled = false;
        document.reporter.chartcontent[2].disabled = false;
    } 
    if (document.reporter.chartcontent[0].disabled == false) {
        document.reporter.chartcontent[0].disabled = true;
        document.reporter.chartcontent[1].disabled = true;
        document.reporter.chartcontent[2].disabled = true;
    } 
        
}

Equality is not the same as assignment operator.

Here's a poem for your signature:

I only told her onthe
I'd write her every month
But thtill thee flipths
Over my lithp
And callth me thuth a dunth.


Ready for "orange" "silver" and "purple"?

Cheers,
[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Edward you are a star...cheerth! -------------------------------------
...what rhymes with month?
 
[lol] Hope I helped / Thanks for helping
if ((Math.abs(x)<10&&Math.abs(y)<10) && (((parseInt(Math.abs(x).toString()+Math.abs(y).toString())-Math.abs(x)-Math.abs(y))%9)!=0)) {alert(&quot;I'm a monkey's uncle&quot;);}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top