Problem with mail template

vjmazcu 12 Sep, 2008
I´have a checkbox group. Every checkbox have the same name for the validator check that there is checked one at least. The problem is in the mail template, that {services} only show the last checkbox value that is checked and no the Previous checkbox that are cheked.

I don´t know the solution for this, anybody know like do it?

Thank you very much
vjmazcu 15 Sep, 2008
With chronocontact.php of the last version and the mail have the same error. The mail only shows one of checkbox group that are checked (the last checked check box of the group). The file chronocontact.php of the last version don´t solved the problem.

The code of check box group is the next:
......
<span class="label_form">Marca el/los servicio/s que necesitas:</span><br/>
          <div align="left">
           <input type="checkbox" name="servicios" id="Agua" value="Agua"><span class="value_form">Agua</span><br/>
           <input type="checkbox" name="servicios" id="Cafes" value="Cafes"><span class="value_form">Cafes</span><br/>
           <input type="checkbox" name="servicios" id="Pastas" value="Pastas"><span class="value_form">Pastas</span><br/>
           <input type="checkbox" name="servicios" id="Zumos" value="Zumos"><span class="value_form">Zumos</span><br/>
           <input type="checkbox" name="servicios" id="Infusiones" value="Infusiones"><span class="value_form">Infusiones</span><br/>          
</div>
.......

and the code of the template is:
<html>
<head></head>
<body>
<b>Nombre:</b> {nombre}<br/>
<b>Sala:</b> {sala}<br/>
<b>Correo Electronico:</b> {E_mail}<br/>
<b>Asunto de Reunion:</b> {evento}<br/>
<b>Servicio que Necesito:</b><br/>
 {servicios} <br/><br/>
</body>
</html>

I don´t know the solution for this, anybody know like do it?

Thank you very much
GreyHead 15 Sep, 2008
Hi vjmazcu ,

Make the checkbox field name an array name="servicios[]" then it will return all the checked values.

If you have several fields with the same name and it is not an array then each one overwrites the previous result.

Bob
vjmazcu 15 Sep, 2008
Thanks Bob.

Can you put an example?

And the name that I should use in mail Template? And What name I use in field validation?

I want use the validation data that the component offers, and i have done a e-mail template, and I'd like use it.

Thank you, very much
Max_admin 15 Sep, 2008
Hi,

add [] in the form code itself, in the template or the validation just use teh field name without []

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vjmazcu 16 Sep, 2008
Thanks Max, but your solution don`t validate that one check box checked at least, and the mail template show "{servicios}" and no his value for wich field of array.

I think that unique solution is validate with javascript. If you know other possibility?

Thanks you very much
Max_admin 16 Sep, 2008
please tell me which Chronoforms version do you have

Regards

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vjmazcu 16 Sep, 2008
I have the ChronoForms_V2.5_J1.5_RC3.1 version
Max_admin 16 Sep, 2008
ok, lets try this with V3.0 stable, will be ready in a few hours.

Regards

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vjmazcu 17 Sep, 2008
Thanks Max, with the new version, using servicios[1], servicios[2], ....., servicios[n], the mail template show the results very good, but what I should put in the field " validate-one-required" in validation.

I have tried with "servicios" and "servicios[]", but don`t validate one check box checked at leaast.

I`m sorry. I'm doing many questions.

Thank you verty much.
Max_admin 17 Sep, 2008
Hi, in the new version, V3.0 stable, you can add {servicios} in the email template and it will work, assuming your field name has []

let me know about this.

regarding the at least one required, it may not work with fields which have multiple values, its for "one only" checkboxes or radios.

Regards

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vjmazcu 18 Sep, 2008
Thanks Max for your help

I'll use javascript.
Max_admin 18 Sep, 2008
No problems, at the next release I will add a normal js alert boxes validation.

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger