cnctrader Posted September 7, 2011 Report Share Posted September 7, 2011 Hi, I'm admittedly a novice with javascript and have a basic question. In a datapage, I am trying to hide a field based upon a users membership level. Following is what I am attempting, but failing miserably: if([@field:Membership_Type] == "Seller"); { } Any help would be greatly appreciated! tom Quote Link to comment Share on other sites More sharing options...
Aariel Posted September 7, 2011 Report Share Posted September 7, 2011 hi, What type of Datapage is this? Is it a 'Search and report DataPage' or a 'detail DataPage' or a 'Submission form'? If a report Datapage, is it a 'tabular' or a 'list'? What field do you want to hide? Quote Link to comment Share on other sites More sharing options...
cnctrader Posted September 8, 2011 Author Report Share Posted September 8, 2011 It is a "submission form" datapage and I am trying to hide a photo based upon the membership level of the user. Thanks Quote Link to comment Share on other sites More sharing options...
bahar_vm Posted September 14, 2011 Report Share Posted September 14, 2011 If it is an authenticated submission form where in the authentication table you have the membership type column which stores the member's type then you can use the following script: if([@authfield:Membership_Type] == "Seller"); { document.getElementById("InsertRecordPHOTO").style.display= 'none'; } Insert an HTML Block and place this script in. The HTML Block should be moved down to the end of all the form elements so it should be the last element in the list. Notes: Replace the "Membership_Type" with the proper field name in your authentication table. Replace the "PHOTO" with your photo field name. Hope this works. Best, Bahar M. Quote Link to comment Share on other sites More sharing options...
cnctrader Posted September 21, 2011 Author Report Share Posted September 21, 2011 Thanks a lot, Bahar! That worked great. Tom Quote Link to comment Share on other sites More sharing options...
cheonsa Posted December 26, 2019 Report Share Posted December 26, 2019 Hello! There is also a way on how to hide a field based on the users membership level. A conditional form is a regular Caspio form with rules consisting of criteria and conditional actions. You can apply conditional rules to create dynamic change forms that fine tune fields based on user entries. In the Rules tab of the DataPage wizard, you can create various conditions to hide, show, require or disable specific fields based on the value or selection of other fields in the same form. You may refer to this link for more information: https://howto.caspio.com/datapages/forms/conditional-forms/ Regards, kristina 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.