Forums

Chronoforms 1.5 to 1.6 - Help please!

MTP 18 May, 2011
Hello,

I used to have chronoforms installed on Joomla 1.5x but I had to upgrade to 1.6 as 1.6 has a better ACL.

Is there a way for me to copy across the 1.5 form I created and place it in 1.6 as I am having trouble with the form wizard in 1.6 as it is completely different to 1.5 version.

Any help on this please?

Thanks in advance!!!
GreyHead 18 May, 2011
Hi MTP,

There is no automatic upgrade from CFv3 to CFv4; you can copy and paste over the Form HTML and the contents of other code boxes but any other part of the form has to be rebuilt from scratch.

Bob
edwinhonk 20 May, 2011
Quite an interesting topic - migrating forms from J1.5 Chronoforms V3x to J1.6 Chronoforms V4...

We have a lot of CF Forms (all "custom" forms - not wizard forms) working well on several sites (with v3x) and ran into trouble migrating our forms to V4 under J1.6. Especially the validation doesn't work for us...

Is the RC 1.8 Chronoforms software really fully functional under J1.6?

Greetings from Germany
Rainer
GreyHead 20 May, 2011
Hi Rainer,

Is the RC 1.8 Chronoforms software really fully functional under J1.6?


Yes - as far as I am aware. There are some changes in the way ChronoForms works from CFv3 and a few small bugs still but all of the main parts work OK.

What problem do you have with validation?

Please post a link to the form so we can take a quick look.

Bob
edwinhonk 20 May, 2011
Thank you for the quick reply!

As a matter of fact, we tried to rebuild the form on:
http://www.frauenheilkun.de/zi/termine-online.html
- on a site which should go online soon.

Then we decided "to give J1.6 a try" on this site - porting all contents and all the functionality wasn't very complicated... but the form.

So far we came up to this J1.6 version of the form:
http://www.frauenheilkun.de/zi2/index.php/termine-online

As soon as we switch on validation, the form won't work properly.
It would produce memory errors on the server - which are due to a loop we produce when switching on "Auto Server Side Validation" "On Submit" with the option "On Submit" for the Event Loop.

The form, the mail back from the form - all works perfect, though.

In the original form we used the "normal" form validation under "validation" (in V3x) and a second validation to stop spammers by IP - a script from this forum (this script isn't implemented in the new form yet).

Any hints?

Thanks in advance

Rainer
GreyHead 20 May, 2011
Hi Rainer,

"On Submit" with the option "On Submit" for the Event Loop.



It needs to be the OnLoad option for the Event Loop to redisplay the form; the OnSubmit option just re-runs the validation and you are getting an infinite loop.

The validation error is, I think, because the snippet jQuery.noConflict(); appears in the page but jQuery isn't loaded so it causes a JavaScript error.

Bob
edwinhonk 21 May, 2011

The validation error is, I think, because the snippet jQuery.noConflict(); appears in the page but jQuery isn't loaded so it causes a JavaScript error.



You are right - the "jQuery.noConflict();" snippet had been in use when you looked at the page...
But this has been forgotten code (we tested even a possible conflict).
Although jQuery should load anyway because the slider element and the drop-down menu uses it.

Even without it it won't work properly, I'm afraid.

It worked one time in the beginning - then it produced a giant loop overnight (with hundreds of empty forms mailed). Too bad I don't remember possible setting changes after this.

The loop, by the way, was due to the setting "On submit" in the Event Loop settings.
So I changed this to "On Load" to stop this error.

But no validation since then.

And a JS validation only works on forms from the wizard:
http://www.frauenheilkun.de/zi2/index.php?option=com_chronoforms&chronoform=Test

(But this didn't work in the J1.5 version either.)

Greetings

Rainer
GreyHead 21 May, 2011
Hi edwinhonk,

I don't see any JavaScript errots on the Personal Details form now. It looks as though the next problem is that the Form HTML is still using the old CFv3 cvalidation classes e.g. class='required' instead of the new CFv4 classes e.g. class="validation['required']" - you can see the new classes on the Test form page.
<input type="text" name="Name" value="" title="Name" class=" validate['required']" size="30" maxlength="150">


Bob
edwinhonk 22 May, 2011
Bob,
you really made my day!

Of course it was:

class=" validate['required']"



didn't even think about looking after possible changes in the code.

Thank you very, very much!


Just one more question...

In the old version I used to stop spammers by locking them out by their IP:
<?
if ( in_array($_SERVER['REMOTE_ADDR'], array('95.215.0.195', '72.43.50.131', '213.30.141.195', '76.10.205.68', '92.61.37.207', '163.13.128.75','92.61.34.22', '203.196.17.129', '194.50.163.246', '78.134.37.58', '8.12.33.159', '91.184.8.222', '212.117.164.64', '90.156.232.168', '60.217.232.44') ) ) {
  return "You are not authorized to use this service!";
}
?>

(I think this code might be from you, by the way...)

I put this code under "Server Side validation Code" in V3x.

Would this code still work in V4 and where would I position it?
Under "Custom Server Side Validation"?

Many, many Thanks
and best regards from Germany

Rainer
GreyHead 23 May, 2011
Hi edwinhonk,

You could put it into a Serverside validation action; but it might be better to divert them before they see the form in which case you could put a Custom Code action in the OnLoad event.

Bob

NB The severside syntax has changed in CFV4.
edwinhonk 24 May, 2011

You could put it into a Serverside validation action; but it might be better to divert them before they see the form in which case you could put a Custom Code action in the OnLoad event.



You are right, of course but I was so glad I did find the old v3 version just to stop them anyway.

Is there any other way to achieve the same effect (at least without using captcha)?

NB The severside syntax has changed in CFV4.



So the V3 version of my code doesn't work in V4... O.K. 🙄

To what extent has the syntax changed?

Is there any chance someone has already made up a solution for V4?

My coding skills are very limited 😶

Best regards

Rainer
GreyHead 25 May, 2011
Hi edwinhonk,

From the CFv4 action help tab

[list]

  • Returning "boolean" false will fail, anything else or no return at all will lead to success.

  • Set fields errors by adding a new key => value entry to the $form->validation_errors array, where "key" is the "field name" and "value" is the "Error message", for example, if you want to set an error to the "email" field you should use this code $form->validation_errors['email'] = "Email error message is here.";.
  • [/list]


    So your code would become
    <?php
    $ip_array = array(
      '8.12.33.159', 
      '60.217.232.44'
      '72.43.50.131', 
      '76.10.205.68', 
      '78.134.37.58', 
      '90.156.232.168', 
      '91.184.8.222', 
      '92.61.34.22', 
      '92.61.37.207', 
      '95.215.0.195', 
      '163.13.128.75',
      '194.50.163.246', 
      '203.196.17.129', 
      '212.117.164.64', 
      '213.30.141.195', 
    );
    if ( in_array($_SERVER['REMOTE_ADDR'], $ip_array ) ) {
      $form->validation_errors['some_input'] = "You are not authorized to use this service!";
      return false;
    }
    ?>

    Note that as you aren't validating an input here this gives a problem with the 'some_input' bit.

    Bob
    This topic is locked and no more replies can be posted.