Disable all elements in a container

I have a container with some text boxes and combo boxes. Is there a way to enable/disable all elements with jquery?


Hello Chris,

JQuery seems to be the best solution.

Something like this:

$(function() {

You can try this example in http://jsfiddle.net/H2LJq/2/

Hope it helps you!

Kind regards.

Daniel Martins.
Thank Daniel, I'll try it later.

Just for completness, Daniel's answer requires that you apply the 'ToDisable' style to the container that wraps the inputs.
Even though you need to apply the style to the container, there's not need to define it in the css. Learn how to apply styles.

To run the jQuery script, you have several options. One option is using the RunJavascript action in the HTTPRequestHandler.
You can reference the HTTPRequestHandler using the Add/Remove References Window.
the attributes should be like  = .attr('disabled','true') =  with "", or you could also try javascript 

function onClick(){
var element = getElementsByTagName('INPUT');
                  for(var x=0; element.length <= x; x++){
                 element[x].setAttribute('disabled', 'disabled');

I suggest to do this (if you are using outsystems 8 with jQuery 1.8.3):
    $(".ToDisable *").prop('disabled',true);

check out http://jsfiddle.net/65a3b/1/

the "star" makes sure you got all nested elements which can be disabled will be disabled (if you want that ofcourse)

ofcourse it doesn;t have to be a class. you can also assign a name to the div and use that as identifier...