If you’re using IE, you can disable all input elements inside a div by setting “disabled=true”.  Unfortunately (thanks to standards compliance nonsense😉 ) it doesn’t work anywhere else.

If you’re using jQuery, take a look here.  If not, this bit of script might help:

function SetDisabledStates( container, newStates )
{
    var states = [];

    var replace = function( element )
    {
        states[ element.id ] = element.disabled;
        element.disabled = isArray( newStates ) ? newStates[ element.id ] : newStates;
    };

    var inputs = container.getElementsByTagName("input");
    for ( var i = 0; i < inputs.length; ++ i ) replace( inputs[ i ] );

    var selects = container.getElementsByTagName( "select" );
    for ( var i = 0; i < selects.length; ++ i ) replace( selects[ i ] );

    return states;
}

function isArray( obj )
{
   return obj.constructor.toString().indexOf("Array") != -1;
}

To preserve and override the states, do something like this:

var disabledStates = SetDisabledStates( myContainer, true );

 

Then to restore the states, do this:

SetDisabledStates( myContainer, disabledStates );