Disable form submit button

Hey folks,

Need a little help. I have a page with three forms. I need to disable form 2 and 3 until all the required fields in form 1 have a value. Once all required fields in form 1 have a value, i need the disabled submit buttons to enable without a page refresh. Any help is appreciated. Thanks!

That should be as easy as setting an onsubmit event for those other forms, which checks to see if what they need is there. If not, they return false to prevent the form from being submitted.

For example:


var shipping = document.getElementById('shipping');
form3.onsubmit = function () {
    if (!validateShoppingCart() || !validatePersonalDetails()) {
        return false;
    }
};

That’s a good starting point for you.