Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
html_options empty option

 
Post new topic   Reply to topic    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
douglassdavis
Smarty Junkie


Joined: 21 Jan 2008
Posts: 521

PostPosted: Sat Nov 22, 2008 12:17 am    Post subject: html_options empty option Reply with quote

how about adding an option to html_options to give an empty option at the beginning. like for when the user wants to select nothing.

it's easier than merging an empty entry at the beginning of the array in PHP.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7047
Location: Lincoln Nebraska, USA

PostPosted: Sat Nov 22, 2008 12:33 am    Post subject: Reply with quote

Many ways to handle it, but probably the easiest:

Code:
<select name="foo">
  <option value=""></option>
  {html_options ...}
</select>
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Feature Requests All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP