Validation problem

Shows some Tutorials

Validation problem

Postby thomaskremer on Sun Apr 27, 2008 10:58 pm

Hi,
I realy like your chronoforms! Everything is working fine... except the validation-part.
I checked the forum and made sure there isn't any space in the names. Still doesn't validate.
Could you have a look at my form?
Tanks!
Thomas

[file name=Inschrijvingen.cfbak size=15089]http://www.chronoengine.com/components/com_fireboard/uploaded/files/Inschrijvingen.cfbak[/file]
thomaskremer
Fresh Boarder
 
Posts: 2
Joined: Sun Apr 27, 2008 3:53 pm

Re:Validation problem

Postby GreyHead on Sun Apr 27, 2008 11:14 pm

Hi Thomas,

Because of the way that the validation works you cannot have 'class' attributes in the 'input' tags. If you do, then CF adds a second class attribute and everything gets confused.

You can work around this by putting the css class attributes in wrapping tags; or, IIRC, someone posted a code hack here recently that will work provided that you have the 'name' and 'class' attributes as the first two.

I'm also not sure that 'required' works with select boxes, you may need 'select one required' instead.

Get the validation working with a couple of simple input tags, then add the others.

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: 3417
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Validation problem

Postby thomaskremer on Mon Apr 28, 2008 1:26 am

Thanks for your quick answer! I'll try to simplify the code, without classes.
Thanks for this great component!
Thomas
thomaskremer
Fresh Boarder
 
Posts: 2
Joined: Sun Apr 27, 2008 3:53 pm

Re:Validation problem

Postby cuhuak on Mon Apr 28, 2008 2:11 pm

Hi all. I tried everything with this code. but validation does not works:
Code: Select all
<script src="test_radio_files/mootools.js" type="text/javascript"></script>
<script src="test_radio_files/mooValid.js" type="text/javascript"></script>
             
<form name="ChronoContact_kettel1" id="ChronoContact_kettel1" method="post" action="http://localhost/test/ru/index.php?option=com_chronocontact&task=send&chronoformname=kettel1" >
<input type="text" name="myin" class="required">
<div>sex: M <input type="radio" name="sex" value="m" class="validate-one-required"> - F <input type="radio" name="sex" value="f" class="validate-one-required"></div>
<input type="submit" value="go" />
</form>
          <script type="text/javascript">
        function formCallback(result, form) {
          window.status = "valiation callback for form '" + form.id + "': result = " + result;
        }
        var valid = new Validation('ChronoContact_kettel1', {immediate : true, onFormValidate : formCallback});
      </script>

How to use "validate-one-required" (moovalidate, with prototype all ok) ??
Could you give a little example where this feature works?

To thomaskremer. I have some code that can help u. this code inserts validation-classes into tags where class attribute were specified (look my more ealier posts).
cuhuak
Fresh Boarder
 
Posts: 10
Joined: Fri Apr 11, 2008 8:39 am

Re:Validation problem

Postby cuhuak on Tue Apr 29, 2008 2:24 pm

i have solved this problem with moovalidate(one-reuquired).
Just replace the code with this:
Code: Select all
   ['validate-one-required', ''Please select one of the above options.', function (v,elm) {
            var p = elm.parentNode;
            var options = p.getElementsByTagName('INPUT');
            b = false;
            ($A(options)).each(function(elm) {
               if (elm.checked==true) {
                   b = true;
               }
            });
            return b;
         }],

it is not so elegant but it works (i am layman in the moo-library).

Post edited by: cuhuak, at: 2008/04/29 10:26<br><br>Post edited by: cuhuak, at: 2008/04/29 10:27
cuhuak
Fresh Boarder
 
Posts: 10
Joined: Fri Apr 11, 2008 8:39 am

Re:Validation problem

Postby admin on Thu May 01, 2008 5:32 am

Thanks cuhuak!
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: 3181
Joined: Mon Aug 14, 2006 5:29 am


Return to ChronoForms How To

Who is online

Users browsing this forum: Google [Bot] and 11 guests

cron