• Resolved juanjosegarzon

    (@juanjosegarzon)


    I′m using this in a html content block and working perfectly.
    I want convert this function to advance the form to next page.


    <script>
    jQuery(document).on(‘change’, ‘[id*=”fieldname391_”]’, function(){
    alert(this.value);
    });
    </script>`

    thanks very much!

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @juanjosegarzon

    Thank you very much for using our plugin.

    I’m not sure what you are trying to implement. But if you created a multipage form and you want to move to the next page from this code, you can edit it as follows:

    <script>
    jQuery(document).on('change', '[id*="fieldname391_"]', function(){
    jQuery('.pbreak:visible').find('.pbNext').click();
    });
    </script>

    Best regards.

    Thread Starter juanjosegarzon

    (@juanjosegarzon)

    Thanks for the reply. I am extremely satisfied with the plugin. I have my developer license and I am working with several new projects.

    Replace “change” with “click” because that’s how I need it to work. It is not clear to me if this could be influencing the error.

    I am using the code you gave me modified as follows:

    <script>
    jQuery(document).on('click', '[id*="fieldname391_"]', function(){
    jQuery('.pbreak:visible').find('.pbNext').click();
    });
    </script>

    Once the html code has been entered, and after clicking on fieldname391 , the form advances two pages and positions itself on page 3, which is non-existent and therefore is shown blank.
    In the address bar I see:”example.com/mysite/#f1p2|f2p0″
    And if I go back the page from the browser if it displays correctly: “example.com/mysite/#f1p1|f2p0”
    My form only have two pages: #f1p0 + #f1p1

    Thanks a lot!

    Plugin Author codepeople

    (@codepeople)

    Hello @juanjosegarzon

    I’m sorry, I don’t know all your form structure, but if you want the code runs with the onclick event, and only once. You can implement it as follows:

    <script>
    jQuery(document).one('click', '[id*="fieldname391_"]', function(){
    if('clicked' in window) return;
    window['clicked'] = true;
    jQuery('.pbreak:visible').find('.pbNext').click();
    });
    </script>

    Note I’m using one instead of on.

    Best regards.

    Thread Starter juanjosegarzon

    (@juanjosegarzon)

    Thank you very much! it worked perfectly! You are great

    Thread Starter juanjosegarzon

    (@juanjosegarzon)

    I rushed to celebrate. I have a new difficulty. This worked to advance to page 2 , but it only allows access to page 2 , once. When returning from page 2 to page 1, is it possible to restart the event so that it works again when clicked?

    Plugin Author codepeople

    (@codepeople)

    Hello @juanjosegarzon

    In this case, please, use the following code:

    <script>
    jQuery(document).on('click', '[id*="fieldname391_"]', function(){
    if('clicked' in window) return;
    window['clicked'] = true;
    jQuery('.pbreak:visible').find('.pbNext').click();
    setTimeout(function(){delete window['clicked'];}, 1000);
    });
    </script>

    I’m using on, but controlling the process with a global JS variable.

    Best regards.

    Thread Starter juanjosegarzon

    (@juanjosegarzon)

    Yes now! I don’t bother anymore! have a nice day!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Onclick event fot a calculated field’ is closed to new replies.