This topic is locked
[SOLVED]

 How to make readonly a field in: Java Event - OnPage

6/30/2010 6:51:22 AM
PHPRunner General questions
S
Seraph author

Hi,

as the title I'd like to make not editable a field (numeric field) only in a EditPage through the "aOnPageLoadEdit" java page config.
Thank you very much!

A
ann 6/30/2010

Hi,
use JavaScript API to set up field as disabled.

Here is a sample:

var ctrl=Runner.getControl(pageid, fieldname);

ctrl.setDisabled();



More information:

http://xlinesoft.com/phprunner/docs/javascript_api.htm

S
Seraph author 6/30/2010



Hi,
use JavaScript API to set up field as disabled.

Here is a sample:

var ctrl=Runner.getControl(pageid, fieldname)

ctrl.setDisabled();



More information:

http://xlinesoft.com/phprunner/docs/javascript_api.htm


Mmhh don't work, maybe I wrong something?
That's what I do:



function OnPageLoadEdit(pageid)

{

var ctrl=Runner.getControl(pageid, 'myField')

ctrl.setDisabled();

}


The "myField" is a simple textfield. And when I try to edit one record I still can edit the "myField"
Any Idea?
thank you very much

A
ann 7/1/2010

Hi,
make sure you've copied exact name of the field. Use JavaScript Onloadevent on the Events tab to enter the code.

If it doesn't help please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error. 'Demo Account' button can be found on the last screen in the program.

S
Seraph author 7/1/2010



Hi,
make sure you've copied exact name of the field. Use JavaScript Onloadevent on the Events tab to enter the code.

If it doesn't help please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error. 'Demo Account' button can be found on the last screen in the program.


I resolved using this:



var testctrl = Runner.controls.ControlManager.getAt('TABLE1', 1, 'myField');

testctrl.setDisabled();


thank you very much!