carpentr Posted August 24, 2016 Report Share Posted August 24, 2016 Hi, I'm working on process that requires different fields to filter values depending on a 'role' field in my user auth table. Some fields will also be display only depending on a field being higher than a certain value (ie field x > 100). I have 7 user roles. Since 1 rule can only be applied to the form inputs, I'm unable to use rules to tackle my problem. I'd have to set 7 rules for each input. Have a couple ideas on how to tackle this problem, but they all involve making duplicate copies of the form for different user roles and applying that rules that way. This solution looks promising, but since I'm embedding my data pages in a PHP page (WAMP Stack) I'm not sure if it's possible to pull the role from the embedded form using JavaScript (my menu bar is in the php file, not the datapage). My only other idea would be to put a blank HTML datapage which redirects to a user-specific input form based on the user's auth role. I'd have to make 7 copies (for each role) which would be a pain to update. Anyone have any other ideas? Carpentr Quote Link to comment Share on other sites More sharing options...
LWSChad Posted August 24, 2016 Report Share Posted August 24, 2016 var someVal = '[@field:someField]' var someUser = '[authfield:someUserField]' var someElement = document.getElementById('elementID'); var someElement1 = document.getElementById('elementID1'); var someElement2 = document.getElementById('elementID2'); if(someVal > 100) { someElement.style.display = 'none'; } if(someUser == 'someParam'){ someElement1.style.display = 'none'; someElement2.style.display = 'none'; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.