This topic is locked
[SOLVED]

Hide back to list button in Add Page

3/21/2023 12:30:54 PM
PHPRunner General questions
F
francesco author

Is it possible to Hide Back to List button based on username? what i found in manual, i had to go in Add Page: BeforeDisplay:

if (Security::getUserName()!="admin")
$pageObject->hideField("??? what to put here???");

thanks
fhumanes 3/21/2023

Hello,

The code JavaScript is:

$('a[id^="backButton"]').hide();

Greetings,
fernando

francesco author 3/21/2023

thanks Fernando, it works.
To find button ID I had to go to that page in web browser, right click on button and choose 'Inspect' and see the ID. In my case the button ID was backButton1

fhumanes 3/22/2023

Hello,

The code I passed you is correct. The "^" symbol means that it is any object that begins by, so it serves 1, 2, ..., that is, for your button, it would also apply.

img alt

Greetings,
fernando

fhumanes 3/22/2023

Hello,

To remove the green banner where the backist button is you have to run this javascript:

$('.alert-success').hide(); // Oculta Menssage OK

Greetings,
ernando

francesco author 3/23/2023

special thanks to Fernando, with his suggests I always solve a lot of problem!