How use the new Validation tab (v. 2.3)?

filipetorres 22 Aug, 2007
Hi all,
I follow the tooltips that recommends to use "field names" to assign form fields to validate. I use the <input name="field_name"> attribute to do that but don't works. What do I miss?

My form HTML:

<fieldset id="block1">
<legend>Block 1</legend>
<div class="row">
<label for="name">Name:</label>
<input class="inputbox" type="text" name="name" size="30" id="nome_id" value="" />
</div>
<div class="row">
<label for="email">E-mail:</label>
<input class="inputbox" type="text" name="email" size="30" id="email_id" value="" />
</div>
</fieldset>
{imageverification}<br />
<input name="submit" value="Submit" type="submit" class="button" id="button_id" />


Validation > 1 - required (not blank):
name, email
Max_admin 23 Aug, 2007
Hi Fillipe,

Unfortunately there is a bug in the validation and it wont work when you have class attrbute at your fields, please remove the class="inputbox" from all your fields or at least those which will be validated.

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
filipetorres 24 Aug, 2007

Hi Fillipe,

Unfortunately there is a bug in the validation and it wont work when you have class attrbute at your fields, please remove the class="inputbox" from all your fields or at least those which will be validated.

Cheers

Max


This is bad. My CSS style sheet will grow up due to the fact that class attribute and others classes associated to each forms fields will be replicated in each one id. Considering that form have 40 fields...
Do you know when this bug will be fixed?

Using this tutorial in ChronoForms 2.3:
http://www.chronoengine.com/content/view/31/39/
Works? Or should I remove all class attribute too?

Thanks.

Filipe<br><br>Post edited by: filipetorres, at: 2007/08/24 16:36
GreyHead 24 Aug, 2007
Hi Filipe,

The tutorial was written before v2.3 so it isn't using the validation in 2.3 (though the JavaScript is the same).

At present ChronoForms doesn't fully parse the form HTML so it doesn't know what's in your 'class' attributes and just adds another one. Having two 'class' attributes in a single input breaks the validation and probably the CSS too.

If all you want the class 'inputbox' for all your validated fields then a possible workaround is to hack the code. Look in chronocontact.php around line 100 and you'll see the class attributes that ChronoForms will add. You could put 'inputbox' in the ones that you want to use.

Bob
filipetorres 17 Oct, 2007
Hi GreyHead,
at present I'm using ChronoForms 2.3.4 and unfortunately this problem with validation continue. How exactly can I put 'inputbox' class attributes? Which line exactly changes?

Filipe

Edited to remove long quote<br><br>Post edited by: GreyHead, at: 2007/10/17 19:00
GreyHead 17 Oct, 2007
Hi filipe,

In chronocontact.php around line 100 you'll find this code:
	if(in_array($name,$arr_all)){
  if(in_array($name,$arr_required)){
    $class_array[] = "required";
  }
If you change this to add your classname then it should be added to all required fields. So it would become:
	if(in_array($name,$arr_all)){
  if(in_array($name,$arr_required)){
    $class_array[] = "required inputbox";
  }
Bob
filipetorres 17 Oct, 2007
Hi GreyHead,
I found a new solution adding a new css style like: form#formID input. Problem solved. Thank you.

Filipe<br><br>Post edited by: filipetorres, at: 2007/10/17 19:45
GreyHead 18 Oct, 2007
Hi filipe,

Excellent, good thinking.

Is the validation working OK now?

Bob
filipetorres 19 Oct, 2007
Not yet GreyHead. Validation only working to one field. When I put two or more name fields, validation works to first only, not to other fields.
I already remove all class attributes from all <input> and <select> tags. What can I do?
GreyHead 19 Oct, 2007
Hi filipe,

Check that the list of fields is comma separated. In some versions of ChronoForms spaces are not allowed so try name1,name2,name3 (in later versions I think spaces are OK).

Bob
filipetorres 23 Oct, 2007
Problem solved. Thank you!

Filipe
Max_admin 23 Oct, 2007
Great!! Thanks Filipe for posting again!🙂

Cheers

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.