This topic is locked

Control of field (write or read access)

9/29/2010 8:21:00 PM
PHPRunner General questions
R
rod author

Hi,
Does anyone know how to control a user from changing a field setting based on a session variable? I have a session variable, call it "admin" and it is a integer field that is "0" for most users, and "1" or higher for managers. I want to control who has access to change some of my fields based on this variable using Javascript onload page. I would also like to set the field background color to grey or some similar color based on the value to let the user know he cannot make changes to this field.
Thanks

Sergey Kornilov admin 9/30/2010

You won't be able to use PHP session variables in Javascript code. I would suggest to use BeforeDisplay event where you can hide controls.
Example: http://xlinesoft.com/phprunner/docs/hide_controls_on_add_edit_pages.htm