This topic is locked
[SOLVED]

 Show HIdden Field in Edit Page After Pressing Custom Button.

5/13/2019 1:28:40 AM
PHPRunner General questions
A
Abhijeet author

Hello All,
Greetings !
I have a simple scenario. I am using phprunner 9.8 Build 30630 x86. I have 1 field on edit page which is hidden in a tab page (single record). I have hidden the field successfully in the first tab page by hide_field command. Now for example purpose there are 2 password fields in the tab page, first is database password (field hidden) and second is user password, Now it is expected that the user should enter password in user password field, the system should compare the user password with database password field(which is hidden) and if the password match then show the FIELDONE field. I have made a custom button on edit page and everything goes fine till here. But after I press "Show Field One" button the field FIELDONE is supposed to be seen by show_field command, but nothing is happening. For your reference purposes, I have attached all possible images and code. Please note that on Server, and client after code, I have kept default code.
After looking at the images, can you please let me know what am I doing wrong here ? I am a noob in php, but have managed to write some code after looking at the documentation.
Please find attached images.

Field Structure

Key Columns

First Tab Edit Page in Editor

Page Settings

Edit Page Before Display

Edit Page Before Process Code

Client Before Edit Page Button Code

Hidden Field Not getting Displayed After Pressing Button in Edit Page
Please help me experts, what am I doing wrong here. What my gut feeling is that if the field is getting hidden, then it should get displayed also on the basis of a condition. I believe this is a conditional formatting. Please advise.
Hope this helps.
Kind Regards,

Abhijeet

A
Abhijeet author 5/15/2019



Hello All,
Greetings !
I have a simple scenario. I am using phprunner 9.8 Build 30630 x86. I have 1 field on edit page which is hidden in a tab page (single record). I have hidden the field successfully in the first tab page by hide_field command. Now for example purpose there are 2 password fields in the tab page, first is database password (field hidden) and second is user password, Now it is expected that the user should enter password in user password field, the system should compare the user password with database password field(which is hidden) and if the password match then show the FIELDONE field. I have made a custom button on edit page and everything goes fine till here. But after I press "Show Field One" button the field FIELDONE is supposed to be seen by show_field command, but nothing is happening. For your reference purposes, I have attached all possible images and code. Please note that on Server, and client after code, I have kept default code.
After looking at the images, can you please let me know what am I doing wrong here ? I am a noob in php, but have managed to write some code after looking at the documentation.
Please find attached images.

Field Structure

Key Columns

First Tab Edit Page in Editor

Page Settings

Edit Page Before Display

Edit Page Before Process Code

Client Before Edit Page Button Code

Hidden Field Not getting Displayed After Pressing Button in Edit Page
Please help me experts, what am I doing wrong here. What my gut feeling is that if the field is getting hidden, then it should get displayed also on the basis of a condition. I believe this is a conditional formatting. Please advise.
Hope this helps.
Kind Regards,

Abhijeet


Hello Team,
Just to keep you updated , this was resolved by Sergey, For your reference please find the solution below, it might be of some help to you.

  1. ClientBefore
    params["pass"] = Runner.getControl(pageid,'USERPASSONE').getValue();
  2. Server

    $record = $button->getCurrentRecord();

    $pass = DBLookup("select TRIM(DATAPASSONE) from DISPLAYTEST where SERIAL=".$record["SERIAL"]);

    if ($pass==$params["pass"])

    $result["result"]="ok";

    else

    $result["result"]="not";
  3. ClientAfter

    if ( result["result"]=="ok" )

    pageObj.showField("FIELDONE");