Multi page problem at loading page 2

webbuilders 13 Sep, 2012
Hi i have made a multipage form as described at tutorial and it seems fine. My problem is that the form is posted at the bottom at the page and if a user press "page 2" then the form loads a link and the page goes at the top. The function works as when i go at the bottom of the page the form is at the page two. For returning at page 1 i dont have the same problem.

What shall i do to fix that ??

Thanks
GreyHead 14 Sep, 2012
Hi webbuilders,

I've never tried but maybe you can add a #tag to the url to refocus the page on the form.

Or maybe this would be better as a tabbed form rather than a multi-page form?

Bob
webbuilders 17 Sep, 2012
How can i add a #tag to the url ?

I have send you pm to see my form at my site live because i have an other problem too with javascript about placeholders labels
GreyHead 17 Sep, 2012
Hi webbuilders,

There's a JavaScript error on the page because there is no ID set for the Submit button. The PlaceHolder script requires it to be 'submit'.

You could add a script snippet on the second page to detect the event=page2 in the url and change the focus if that is present. But personally I'd probably use a tabbed form here rather than a multi-page one.

Bob
webbuilders 17 Sep, 2012

Hi webbuilders,
There's a JavaScript error on the page because there is no ID set for the Submit button. The PlaceHolder script requires it to be 'submit'.



I have added to both submit buttons the ID submit but no change at the form labels

You could add a script snippet on the second page to detect the event=page2 in the url and change the focus if that is present.



Any help on that ??
GreyHead 17 Sep, 2012
Hi webbuilders,

In the script you have
var inputs = $$('#direct-contact input[type=text], textarea');
but this isn't the ID of the form. In the tutorial it has
var inputs = $$('#chronoform_my_form_name input[type=text], textarea');
so the correct version would be
var inputs = $$('#chronoform_direct-contact input[type=text], textarea');

Bob
webbuilders 18 Sep, 2012
Thanks for your help...

I would like to ask two things that i have not yet fixed ....

1. how to add the #url exactly for second page load problem i have ??
2. Why at greek characters the validation is not validating correctly ?? What shall i do for that ?

Thanks
GreyHead 24 Sep, 2012
Hi webbuilders,

Here is a JavaScript snippet that will read the current URL and set the focus:
window.addEvent('domready', function() {
  var url = window.location.href.toURI();
  if ( url.getData('event') == 'page2' ) {
    $('focus_here').focus();
  }
});
You will need to replace 'focus_here' with the id of the element you want to focus on.

Please see this FAQ for validation using alphabets other than A-Z.

Bob
webbuilders 26 Sep, 2012
I must be missing something.

I added the function you gave me and made a lot of tests but no luck.
Can you take a look what i have done wrong ? I added a "Load JS" element on submit and on load event. I also added the id of the element subject that is on page two

Thanks
GreyHead 26 Sep, 2012
Hi webbuilders,

By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

Bob
GreyHead 26 Sep, 2012
Hi webbuilders,

Two main points to check,

a) Serverside validation will only run when the form submits so it needs to be in the On Submit event. In the On Load event it normally won't do anything.

b) JavsScript will only run when the form loads so it needs to be in the On Load event and the Page2 event. It normally won't do anything in the On Submit event.

You may be able to test the Greek character set with \p{Greek} but you will be better off checking with Google as there are likely to be Greek sites with better answers.

Bob
webbuilders 26 Sep, 2012
I have already test it that way and it was not working that's why i told you to help me (i tried it at all positions). I have the javascript at positions you mention but does not work i also tried with input id and div id but no luck.

Thanks
GreyHead 26 Sep, 2012
Hi webbuilders,

When i looked at your forms both the JavaScript to check the URL and the Custom ServerSide validation were in the wrong events.

Bob
webbuilders 26 Sep, 2012

Hi webbuilders,

When i looked at your forms both the JavaScript to check the URL and the Custom ServerSide validation were in the wrong events.

Bob



No problem with that .. Now that is at right position and not working what to do?
GreyHead 26 Sep, 2012
Hi webbuilders,

You get to debug the code. Step by step. Use your web browser developer tools and the ChronoForms debugger to see what is happening.

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