This topic is locked

How to hide controls on Add/Edit pages

9/7/2007 10:43:53 AM
ASPRunnerPro Tips and tricks
admin

ASPRunnerPro 5.2

This is a two step process

  1. Proceed to the Edit page, switch to HTML mode and wrap the code section with wrappers (in bold) as shown below:
    {if $admin_user}

    <TR>

    <TD class=shade width=150>Horsepower</TD>

    <TD width=250>

    {build_edit_control field="Horsepower" value=$value_Horsepower mode="edit"}

    </TD></TR>
    {/if}


2. Now you need to implement BeforeShowEdit event and put the following code there:

smarty.Add "admin_user", SESSION("UserID")="admin"


Horsepower edit box will be shown only if username equals "admin".
ASPRunnerPro 6.0
To hide Horsepower field add BeforeShowEdit event on the Eventstab and put the following code there:

xt.assign "Horsepower_fieldblock",SESSION("UserID")="admin"


Horsepower edit box will be shown only if username equals "admin".

M
mkueffner 9/29/2007

This is a two step process


  1. Proceed to the Edit page, switch to HTML mode and wrap the code section with wrappers (in bold) as shown below:
  2. Now you need to implement BeforeShowEdit event and put the following code there:

smarty.Add "admin_user", SESSION("UserID")="admin"


Horsepower edit box will be shown only if username equals "admin".


Is there a way to add this to more than one UserID? Say, you want the same field visible for admin user and user1 user.
thanks.

admin 10/1/2007

Try this:

smarty.Add "admin_user", SESSION("UserID")="admin" or SESSION("UserID")="user1"
A
akira_nagasaki 1/11/2009

Try this:


smarty.Add "admin_user", SESSION("UserID")="admin" or SESSION("UserID")="user1"


hi
i tried apply the same method above but my page getting error Object required. how to solved it <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=36706&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />

admin 1/13/2009

akira_nagasaki,
I recommend to post your application to Demo Account and open support ticket at http://support.xlinesoft.com sending your application URL.