This topic is locked
[SOLVED]

How to disable a button ?

4/12/2022 8:58:38 AM
PHPRunner General questions
J
Jan author

I use phprunner 10.7 and I want to disable a button. I can find this code in the help function :

pageObj.getItemButton('buttonname').addClass('disabled');

But this code doesn't work because I get an error message. Which code is the correct code? Thanks.

J
Jan author 4/12/2022

remark :
I want the status of the button to depend on the value from a table, so I want to apply the "if statement" in the code

fhumanes 4/13/2022

Javascript:
Read: https://xlinesoft.com/phprunner/docs/getitembutton(itemid_recordid).htm

// disable the button
pageObj.getItemButton('custom_button').addClass('disabled');

PHP:
Read: https://xlinesoft.com/phprunner/docs/hideitem.htm

Regards,
fernando

J
Jan author 4/15/2022

Thank you, this code works great in the Java Script on Load Event.
I am almost there: depending on the value of a field in a table, I want a button disables or enables. Can I request the field name of a table in the Java Script on Load Event? or do I have to work with a variable that I make "Public" ??

fhumanes 4/17/2022

Hello,

Phprunner gives you many possibilities for in JavaScript to control fields of fields and even, do operations in case some field changes value.

I have this article where many cases are explained and how those controls can be coded. https://fhumanes.com/blog/guias-desarrollo/guia-1-para-noveles-en-phprunner/

Greetings,
fernando