• Resolved alevel

    (@alevel)


    Hi,

    In a multi-page form, I want to use the current (visible) pagenumber in a calculated field. I tried jQuery selectors: $(‘.pbreak:visible’) or $(‘div[style*=”display: block”].pbreak’) and all sorts of variations, but none seem to work. How do I get the current page number in my calculated field? Thanks!

    Rgds, Alex

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

    (@codepeople)

    Hello @alevel

    Please, don’t use the shortcut for jQuery in the equations’ context. You cannot ensure the shortcut ($) will be available in this context. You can use the equation:

    SUM(jQuery('.pbreak:visible').attr('page'),1)

    Best regards.

    Thread Starter alevel

    (@alevel)

    Hi,

    I’m sorry to say, but this does not work. This always returns the value 1 (so attr(‘page’) = 0), regardless of what is the actual current page.

    Rgds, Alex

    Plugin Author codepeople

    (@codepeople)

    Hello @alevel

    You must reevaluate the equation every time the user change of page. For example, assuming the calculated field is the fieldname123 (you should use the name of the field on your page), please, insert an “HTML Content” field in the form with the following piece of code as its content:

    <script>
    jQuery(document).on('cff-gotopage', function(){
     EVALEQUATION('fieldname123');
    });
    </script>

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Current page number’ is closed to new replies.