|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Aryya Smarty n00b
Joined: 21 Apr 2014 Posts: 1
|
Posted: Mon Apr 21, 2014 7:41 am Post subject: How to hide questions under each section in a long form |
|
|
Hi everyone,
I'm very new to smarty and I'm trying to figure out a way to hide questions under each section in a long form. I would need to add some id or class to the section name and some div to wrap to the questions under this specific question so I can target them in css or js, but I'm breaking my head to find a way to do that with smarty.
Here is my code:
Code: | {if !empty($questionList)}
{foreach from=$questionList key='section' item='questions'}
{if !empty($section) }
<tr class="ow_tr_first"><th colspan="3" class="section_label">{text key="base+questions_section_`$section`_label"}</th></tr>
{/if}
{foreach from=$questions item='question' name='question'}
<tr class="{cycle values='ow_alt1,ow_alt2'} {if $smarty.foreach.question.last}ow_tr_last{/if}">
<td class="ow_label">
{label name=$question.name}
</td>
<td class="ow_value">
{input name=$question.name}
<div style="height:1px;"></div>
{error name=$question.name}
</td>
</tr>
{/foreach}
<tr class="ow_tr_delimiter"><td></td></tr>
{/foreach}
{/if} |
Any help would be awesome |
|
Back to top |
|
|
|
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
|