Display buttons depend on userid

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Scriplet
Forum Newbie
Posts: 1
Joined: Mon Nov 07, 2005 9:31 pm

Display buttons depend on userid

Post by Scriplet »

I use template engine(smarty), first I create one template html
<form .... >
...

<input type="button" value="Update">
<input type="button" value="Delete">
<input type="button" value="Add">
<input type="button" value="Print">
<input type="button" value="Return">
...
</form>

In php code, I load this template but I want display buttons depend on userid.
Ex: With userid == 2 , I want display 3 button Update, Print, Return. How to display 3 buttons Update,Print, Return nearly and 2 button Delete,Add don't display.
Last edited by Scriplet on Mon Nov 07, 2005 10:27 pm, edited 1 time in total.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Sorry, what? Could you please explain again?
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

He wants it like this :arrow:

Code: Select all

if ($userid==1)
{
  //display all the buttons
}
elseif($userid==2)
{
  //display update, print & return buttons
}
I do understand you but i haven't (and don't want to :) ) worked with Smarty so I can't help you...
Post Reply