Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

How to hide questions under each section in a long form

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Aryya
Smarty n00b


Joined: 21 Apr 2014
Posts: 1

PostPosted: Mon Apr 21, 2014 7:41 am    Post subject: How to hide questions under each section in a long form Reply with quote

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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General 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