Mootool Disable/Enable text box

Hello Guys

Mootool Help

I have two radio box BPremium Listing[/B], B Free Listing[/B] now I want to disable all those input field (text box) having class=“paidfield” when I click on BFree Listing[/B] and enable when I click on () Premium List.

I need this in Mootool because my application is using Mootool only.

I am not well in Mootool so please help me.

Deep Singh

This is the javascript you need which I’ve tested and it works perfectly

var elements = document.getElementsByTagName('input');

function FreeListing(){
    for(var i=0; i<elements.length; i++){
        if ($(elements[i]).hasClass('paidfield')){
            $(elements[i]).setProperty('disabled', true);
        }
    }
}

function PremiumList(){
    for(var i=0; i<elements.length; i++){
        if ($(elements[i]).hasClass('paidfield')){
            $(elements[i]).setProperty('disabled', false);
        }
    }
}

and this is the HTML to disable and enable the input elements.

<a href="javascript:FreeListing()">Disable All</a> - <a href="javascript:PremiumList()">Enable All</a>