changing disabled property

Hi,

I am trying to change the disabled property of a text field using java script. I have a tabSet in which I have a table with text field and a button in a column. The disabled property is set to true for the text field. The idea is to click on the button to change the disabled property. I have this javascript function which does the same.

function EditRow(aRowNumber)

{

var btn = document.getElementById("form1:tabSet1:tbUnassigned:layoutPanel5:groupPanel1:ta ble5:tableRowGroup5:"+aRowNumber+":tableColumn17:textField3");

btn.disabled = false;

}

and the following in my java file before init method

public String getRowNumber(){

return tableRowGroup5.getRowKey().getRowId();

}

But this doesnt seem to work. Is there anything wrong in the function. Please help.

Thanks,

Sruthi.

[870 byte] By [spotineni] at [2007-11-26 8:48:55]
# 1

Just set your button's onClick property to something like this:

var f = function() {var tf = document.getElementById('form1:tabSet1:tab1:table1:tableRowGroup1:#{Page1.rowNu mber}:tableColumn1:textField1'); tf.disabled = !tf.disabled; return false;}; return f();

And you should be able to toggle the textfield between enabled and disabled.

mbohm at 2007-7-6 22:37:55 > top of Java-index,Development Tools,Java Tools...