0

Is it possible to nest manually constructed checkbox/radio.. Check my code..

 {options:source_de_revenu}
                {if option_value == 'autre'}
                <div class="small-12 large-6 column">
                    <input type="checkbox" class="check-more" name="source_de_revenu[]" value="{option_value}" {checked}>
                    <label style="margin-right:4px">{option_name} :</label>
                    <label for="sr_autre_nom" class="more-infos inline-input" style="{if sr_autre_nom == '' }display: none{/if}">Spécifier :
                        <input type="text" class="inline-input" name="sr_autre_nom" id="sr_autre_nom" value="{sr_autre_nom}">
                    </label>
                </div>
                {if:elseif option_value == 'ae'}
                <div class="small-12 large-6 column">
                    <input type="checkbox" name="source_de_revenu[]" value="{option_value} " {checked} class="check-more checkbox-group">
                    <label>{option_name} </label>
                    <div class="more-infos">
                        <blockquote> {options:sr_ae_contrainte}
                            <input value="{option_value}//// HERE OPTION VALUE IS NOT THE "nested value /////" type="radio" class="radio-group" name="sr_ae_contrainte" {checked}>
                            <label>{option_name}//// HERE OPTION NAME IS NOT THE "nested name /////</label>
                            <br>
                            {/options:sr_ae_contrainte} </blockquote>
                    </div>
                </div>
                {if:else}
                <div class="small-12 large-6 column">
                    <input type="checkbox" name="source_de_revenu[]" value="{option_value}" {checked}>
                    <label> {option_name}</label>
                </div>
                {/if}
                {/options:source_de_revenu}
0

I solved it by enabling PHP (Outpout parsing) and adding the manually constructed radio OUTSIDE the other tag like so

<?php $s_ae = '{options:sr_ae_contrainte}<input value="{option_value}" type="radio" class="radio-group" name="sr_ae_contrainte" value="{option_value}" {checked} ><label>{option_name}</label><br> {/options:sr_ae_contrainte}';
                ?>

            {options:source_de_revenu}
            {if option_value == 'autre'}
            // SOME CODE
            {if:elseif option_value == 'ae'}
            <div class="small-12 large-6 column">
                <input type="checkbox" name="source_de_revenu[]" value="{option_value}" {checked} class="check-more checkbox-group">
                <label>{option_name}</label>
                <div class="more-infos">
                    <blockquote> <?php echo $s_ae; ?> </blockquote>
                </div>
            </div>

            {if:else}
            <div class="small-12 large-6 column">
                <input type="checkbox" name="source_de_revenu[]" value="{option_value}" {checked}>
                <label> {option_name}</label>
            </div>
            {/if}
            {/options:source_de_revenu}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.