validation problem

Post any questions you may have here

validation problem

Postby ciccio on Sat Jul 19, 2008 11:28 am

hello and thanks for this component, it's awesome!

I followed the video tutorial for the validation of all the fields, but does't work with my site, i use joomla 1.5.2 with php 4.1

First i tried with the php code to link the prototype.js and validation.js files; then i used the tag <src as you do in the tutorial, but nothing changed, maybe the problem is another.

This is the final code i have inside Form Html:

Code: Select all
<script src="http://www.thebamby.com/components/com_chronocontact/prototype.js" type="text/javascript"></script><br>
<script src="http://www.thebamby.com/components/com_chronocontact/validation.js" type="text/javascript"></script>



  <p>
    <label class="label">Name</label>
    <input name="Name" type="text" class="field" value="" />
  </p>
  <p>
    <label><span class="label">Telephone</span></label>
    <input name="Telephone" type="text" class="field" value="" />
     </p>
  <p><label><span class="label">Email</span></label>
  <input name="email" type="text" class="field" value="" />
   </p><br />
   

  <label>invia
  <input type="submit" name="invia" id="invia" value="Invia" />
  </label>



<script type="text/javascript" >
new Validation(this);
  function formCallback(result, form) {
    window.status = "validation callback for form '" + form.id + "': result = " + result;
}
var valid = new Validation('my_form', {immediate : true, onFormValidate : formCallback});

</script>



The form works fine, only te validation doesn't.

Can someone help me with this ?

thanks in advance
ciccio
Fresh Boarder
 
Posts: 2
Joined: Fri Jul 18, 2008 11:18 pm

Re:validation problem

Postby GreyHead on Sat Jul 19, 2008 12:09 pm

Hi ciccio,

Remove the validation code from your form code and use the Validation tab in the form manager instead and ChronoForms will handle everything else. (You also need to remove the class attributes from the input tags:
Code: Select all
   <p>
    <label class="label">Name</label>
    <input name="Name" type="text" class="field" value="" /> 
  </p>
  <p>
    <label><span class="label">Telephone</span></label>
    <input name="Telephone" type="text" value="" />
     </p>
  <p><label><span class="label">Email</span></label>
  <input name="email" type="text" value="" />
   </p><br />
     
 
  <label>invia
  <input type="submit" name="invia" id="invia" value="Invia" />
  </label>
Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3253
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:validation problem

Postby ciccio on Sun Jul 20, 2008 1:05 am

Thank you very much, now it works perfectly!

Last thing,

how can i do to use css tag inside the field, i used class="field", but as you notice, doesn't works with the validation.

Thanks
ciccio
Fresh Boarder
 
Posts: 2
Joined: Fri Jul 18, 2008 11:18 pm

Re:validation problem

Postby admin on Sun Jul 20, 2008 5:59 pm

You cant right now, alter your css to use the validation classes, the next version of Chronoforms will allow this though!

Cheers

Max
ChronoForms/ChronoConnectivity/ChronoComments Developer Thanks for using our components!
If you have any problems with any extension please tell us.
If you like any of our extensions please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
Want to have stylish AJAX comments ? try ChronoComments
User avatar
admin
Platinum Boarder
 
Posts: 2330
Joined: Mon Aug 14, 2006 5:29 am

Re:validation problem

Postby GreyHead on Mon Jul 21, 2008 3:44 pm

Hi ciccio,

You can either put the validation classes in manually like class="field required" (if you do that, turn validation on but *don't* put the field names in the Validation tab);

Or you can use css selectors like form.input to identify the tags without using a class attribute.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3253
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany


Return to ChronoForms Questions & Answers

Who is online

Users browsing this forum: Gigabot [Bot], Google [Bot], Yahoo [Bot] and 1 guest