Jump to content

Show Selected Contact


alinford

Recommended Posts

On the clientarea.php?action=contacts page, when I choose the contact I want to view from the dropdown, it goes to that contact, but then the dropdown field defaults back to the first contact on the list.

 

I would like the dropdown to show whatever contact I have chosen, and not default back to to the first contact.

 

Normally, I would use the "Selected" tag to choose a selected option, but I do not know how to use "Selected" as a variable, and show the current contact.

 

Any idea how I can accomplish this?

 

I am using the "Default" template on V5.

 

Here is the code I am currently using:

 

<form method="post" action="{$smarty.server.PHP_SELF}?action=contacts">
<div class="alert-message block-message info">
<p>{$LANG.clientareachoosecontact}: <select name="contactid" onchange="submit()">
   {foreach item=contact from=$contacts}
       <option value="{$contact.id}">{$contact.name} - {$contact.email}</option>
   {/foreach}
   <option value="new">{$LANG.clientareanavaddcontact}</option>
   </select> <input class="btn" type="submit" value="{$LANG.go}" /></p>
</div>
</form>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated