Forum

Thread tagged as: Problem, Forms

[Solved] Radio buttons labels problem in form app

Hello,

I've got a problem with the labels on form app with radio buttons. My initial HTML code is fine but the template generates the labels in double, only for radio buttons. For the other inputs it's ok.

The template looks like this :

<fieldset>
<legend>Vous êtes</legend>
<p><span class="input-wrap"><perch:input type="radio" name="type" id="pro" value="professionnel" /> <perch:label class="after" for="pro">Un professionnel</perch:label></span> <span class="input-wrap"><perch:input type="radio" name="type" id="particulier" value="particulier" /> <perch:label class="after" for="particulier">Un particulier</perch:label></span> <span class="input-wrap"><perch:input type="radio" name="type" id="collectivite" value="collectivite" /> <perch:label class="after" for="collectivite">Une collectivité</perch:label></span></p>
</fieldset>

The generated HTML looks like this :

<fieldset>
<legend>Vous êtes</legend>
<p><span class="input-wrap"><input id="form1_pro1" name="type" type="radio" /><label for="form1_pro1"></label> <label class="after" for="form1_pro">Un professionnel</label></span> <span class="input-wrap"><input id="form1_particulier1" name="type" type="radio" /><label for="form1_particulier1"></label> <label class="after" for="form1_particulier">Un particulier</label></span> <span class="input-wrap"><input id="form1_collectivite1" name="type" type="radio" /><label for="form1_collectivite1"></label> <label class="after" for="form1_collectivite">Une collectivité</label></span></p>
</fieldset>

I've set the form before installing the Form App. So I deleted the region, installed the Form App et recreated the region. Could it be the source of the problem ? How to solve it ? I've updated many time te content via Back-Office to test and re-test but it didn't solve anything.

FYI :


Perch: 2.7.9, PHP: 5.5.9-1ubuntu4.5, MySQL: 5.5.40, with PDO Server OS: Linux, fpm-fcgi Installed apps: content (2.7.9), assets (2.7.9), categories (2.7.9), perch_forms (1.8.2) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', ); PERCH_LOGINPATH: /perch PERCH_PATH: /home/ccdagency/purestation/perch PERCH_CORE: /home/ccdagency/purestation/perch/core PERCH_RESFILEPATH: /home/ccdagency/purestation/perch/resources Image manipulation: GD PHP limits: Max upload 16M, Max POST 16M, Memory: 256M, Total max file upload: 16M Resource folder writeable: Yes HTTP_HOST: purestation.ccdagency.com DOCUMENT_ROOT: /home/ccdagency/purestation REQUEST_URI: /perch/core/settings/diagnostics/ SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Christophe Cussigh-Denis

Christophe Cussigh-Denis 0 points

  • 6 years ago

I didn't remember that template tags are differents for radio buttons. Here is the good tag :

<p><perch:input type="radio" id="type" name="Type" options="Un professionnel, Un particulier, Une collectivité"  wrap="span.input-wrap" /></p>

I just need to add a class to label. I will use CSS targeting ;)