For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > October 2006 > html_options-Syntax









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author html_options-Syntax
Peggy Schatz | screen-card.design

2006-10-09, 8:06 am

Hello,

my Smarty-template contains a variety of drop-down-fields and other form
data. Layout-related data for drop-down-lists are contained in $drop
(associative array).

Trying to build form elements via Smarty I encounter problems.
If I output the following I get the desired strings, but not when
included within another smarty-plug-in-function...

working:

{$drop.fscm_1.name} - returns 'myname'
bg_{$drop.fscm_1.color} - returns 'bg_yellow'
{$drop.fscm_1.width}px - returns '100px'
{$drop.fscm_1.js} - returns 'myfunction()'

not working: (problems with class and style)

{html_options name=$drop.fscm_1.name values=$fscm_1 output=$fscm_1
class=bg_$drop.fscm_1.color style=width:$drop.fscm_1.width
onchange=$drop.fscm_1.js}

I tried double quotes, but same results.
The output is as follows:

<select name="myname" class="bg_Array.fscm_1.color"
style="width:Array.fscm_1.width" onchange="myfunction()">

Thanx for helping!

Peggy
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com