I am trying to create a button that connects users to a details page depending on their access level. Here is what I have in the button right now (URL changed):
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.
Question
ababcock
I am trying to create a button that connects users to a details page depending on their access level. Here is what I have in the button right now (URL changed):
<input onclick="window.open('https://sample.org/edit.html?ID=[@field:Contact_Sheet_Number]')" type="button" value="Edit Content" />
I would like to adjust that so it directs
- user level users to one page: https://sample.org/edit.html
- management level users to one page: https://sample.org/edit1.html
- admin level users to one page: https://sample.org/edit2.html
I was directed to this page for help: http://howto.caspio.com/tech-tips-and-articles/common-customizations/create-user-specific-redirect-after-login/ which explains redirect after login based on access level, but I was wondering if I could just insert the HTML code into the HTML box my button is in (rather than a standalone login screen). Here is the code they recommend:
<script>
if("[@authfield:Admin]" == "Yes"){
window.location = "http://www.mysite.com/admin.html";
}
else if ("[@authfield:Manager]" == "Yes"){
window.location = "http://www.mysite.com/manager.html";
}
else{
window.location = "http://www.mysite.com/employee.html";
}
</script>
Link to comment
Share on other sites
4 answers to this question
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.