|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 ing! Peggy |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Mon, Oct 09, 2006 at 02:49:54PM +0200, Peggy Schatz | screen-card.design wrote:
> 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()"> read about backticks: http://smarty.php.net/manual/en/lang...tax.quotes.php > Thanx for ing! > > Peggy > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
> read about backticks: > http://smarty.php.net/manual/en/lang...tax.quotes.php > > I had read that after I found related topics on the forum before. Obviously I didn't set the backticks correctly. Thanks for getting me to try once more... The following does the job: {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} Ciao, Peggy |
|
![]() |
| Outils de la discussion | |
|
|