How to get "Value" of One Way Toggle Checkbox.

Hi gays:

I need make one proyect of portlet, and I need obtein the value of “One Way Toggle Checkbox”, I read in the documentation at the method .getValue() request “true” or “”. But I not obtein the value.

This is my code, that I have in one Script Block:

Event.observe($(’#{activePageBean.clientIds[‘togglefour’]}’), “click”, function() {


var seleccion = CAF.model(’#{activePageBean.clientIds[‘togglefour’]}’).getValue();


	if(seleccion = 'true')
		alert("Yes inside");
            else if(seleccion != "true")
                    alert("Not inside");


One suggestions that how obtein the value???

Please try this:

var toggle4 = CAF.model('#{activePageBean.clientIds['togglefour']}');
var value = toggle4.element.getValue();

If the item is checked, the value will be “on”. If it isn’t checked, the value will be “null”. (At least on Firefox)


Thanks for your support, I applied your code and worked :).