Reply to html options from template

Your name:

Reply:


Posted by Dustin on 04/23/05 01:45

Hi,

I would like to have my options come from the template to make it easy
for designers to add/edit them instead of assigning from a PHP array.

Something like this

<select name="hdegree">
<option value=""></option>
<option value="High School" {isselected v=$hdegree o="High School"}>High
School</option>
<option value="Trade School" {isselected v=$hdegree, o="Trade
School"}>Trade School</option>
<option value="Associates Degree" {isselected v=$hdegree, o="Associates
Degree"}>Associates Degree</option>
<option value="Bachelor Degree" {isselected v=$hdegree, o="Bachelor
Degree"}>Bachelor Degree</option>
<option value="Advanced Degree" {isselected v=$hdegree, o="Advanced
Degree"}>Advanced Degree</option>
</select>

But would like it easier. I don't think this assign is valid but just
for sake of how I would like to do it.

{assign var=degrees value=array("High School","Trade School","Associates
Degree","Bachelor Degree","Advanced Degree")}

<select name="hdegree">
{html_options values=$degrees output=$degrees selected=$hdegree}
</select>

Maybe a variable modifier could turn something like this into a smarty
array variable?

{"High School,Trade School,Associates Degree,Bachelor Degree,Advanced
Degree"|arrayify:"degrees"}

Thanks,
Dustin

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация