css - Smarty - How to hide questions under each section in a long form -


I am very new to tricks and I am trying to explain a way to hide the questions under each section title long form. I will need to name the section name and some division in the questions under this specific section title so that I can target them in CSS or JS, but I'm breaking my head to find a way to do this With peak

This is my code:

  {if! Empty ($ question list)} {foreach = $ questionList key = 'section' item = 'questions'} {If! Empty ($ section)} & lt; Tr class = "ow_tr_first" & gt; & Lt; Th colspan = "3" class = "section_label" & gt; {Text key = "base + question_section_` $ section`_label"} & lt; / Th & gt; & Lt; / TR & gt; {/ If} {$ = $ question item = name 'question' by name * 'question' name = 'question'} < Tr class = "{cycle values ​​= 'ow_alt1, ow_alt2'} {if $ smarty.foreach.question.last} ow_tr_last {/ if}" & gt; & Lt; Td square = "ow_label" & gt; {Label name = $ question.name} & lt; / Td> & Lt; Td square = "ow_value" & gt; {Input name = $ question.name} & lt; Div style = "height: 1px;" & Gt; & Lt; / Div & gt; {Error name = $ query.name} & lt; / Td> & Lt; / TR & gt; {/ Foreach} & lt; Tr square = "ow_tr_delimiter"> gt; & Lt; TD & gt; & Lt; / Td> & Lt; / Tr & gt; Any help would be awesome :)  

">

You can try to use the current currency of the first foreign currency to create a unique identifier / class: {foreach = $ questionList key = 'section' item = 'Question' name = 'loop'} {if! Empty ($ section)} & lt; Tr class = "ow_tr_first" & gt; & Lt; Th colspan = "3" class = "section_label" id = "question {$ smarty.foreach.loop.iteration}" & gt; {Text key = "base + question_section_` $ square_label"} and / tr> {/ If} & lt; Tr class = "question {$ smarty.foreach.loop.iteration} _child {cycle values ​​= 'ow_alt1, ow_alt2'} {if $ smarty.foreach.loop.last} ow_tr_last {/ if}" & gt;

Then you will end up with something like this:

  & lt; Tr & gt; & Lt; Th class = "section_label" id = "question1" & gt; & Lt; / Th & gt; & Lt; / TR & gt; & Lt; tr class = "question1_child" & gt; .... & lt; / Tr & gt; & Lt; tr class = "question1_child" & gt; .... & lt; / Tr & gt; & Lt; Tr class = "question1_child" & gt; .... & lt; / Tr & gt; & Lt; Tr & gt; & Lt; Th class = "section_label" id = "question 2" & gt; & Lt; / Th & gt; & Lt; / Tr & gt; & Lt; Tr class = "question2_child" & gt; .... & lt; / Tr & gt; & Lt; tr class = "question2_child" & gt; .... & lt; / Tr & gt; & Lt; Tr class = "question2_child" & gt; .... & lt; / Tr & gt;   

And it would be easy to target with CSS or Javascript, which means that everyone hides. Question 1_Chill or all # ADN name + '_bid' is pressed when a fixed .section_label is pressed

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -