This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

Review Page jumps to top - v3.4


  1. conceive
    Member

    Hi Yuniar, I've seen this issue answered for v2.x but not yet for v3

    I'm having the opposite issue as the others. I have my form at the bottom of a page after lots of text. When user submits form for review the page refreshes to the top and the review screen is way down at the bottom under all my client's text. Can I get the page to keep it's position in the viewport to where the review screen is when user clicks submit? Otherwise, user doesn't know the form is waiting for more input.

    [fyi- I'm using the js embed code] Should I be using php?
    And I am using an anchor tag [name="form"] as well.

    Thx!

    Posted 11 years ago #
  2. yuniar

    A modification is needed on your "js/machform_loader.js" file. Search for this code:

    onload="javascript:parent.scrollTo(0,0);"

    remove that code.

    If you are having difficulty (since the file is being minified) please contact us directly and we'll send you the un-minified version of the file.
    You can mail to: customer.service [at] appnitro.com


    MachForm Founder

    Posted 11 years ago #
  3. conceive
    Member

    That worked fine, but now I'm getting the following error upon submit:

    Warning: Invalid argument supplied for foreach() in C:\inetpub\machform\includes\post-functions.php on line 2734
    SQL: [80] INSERT INTO <code>ap_form_15965</code>(<code></code>) SELECT <code></code> from <code>ap_form_15965_review</code> WHERE id=? Params: 1 Key: Position #0: paramno=0 name=[0] "" is_param=1 param_type=2 Query Failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column '' in 'field list'
    Posted 11 years ago #
  4. yuniar

    That error message is not related with the above change.
    Most likely you are testing your form while in the middle of editing it.

    Try to restart your browser and test your form again, so that it will start with a new session.


    MachForm Founder

    Posted 11 years ago #
  5. conceive
    Member

    I checked. You are right. that explains the SQL message. Thx Yuniar!
    :]

    Posted 11 years ago #
  6. simonb
    Member

    Hi Yuniar,
    I am having the same problem but removing that code from the js just sends me to the bottom of my website when i click submit to go to the review page and my iframe is higher than that.

    I have an A Name in place ( Like the previous user = Anchor Tag ) which I am using to jump down to the form when a user clicks on the link.

    Is there anyway to make it reload ( after hitting submit then going to the review page )
    at the top of the iframe instead of the top of the website page ?

    I have tried adding into machform-loader.js a lot of different code I have found but none of them will let the form load.

    eg.
    onload="javascript:parent.scrollTo('a#myAname');"
    onload="javascript:parent.location.hash='myAname';"
    etc

    One thing that I don't want it to do is on page load ( They go to the form page ) before the submit button has been clicked,
    JUMP right to the form ( As I found it did in other testing )

    Only when they hit submit to go to the review page, should it then reload the page
    RIGHT BACK WHERE THE TOP OF THE FORM IS AND NOT THE TOP OF THE WEBPAGE and go to the A Name area or the Machform div id

    Can you help?
    [I am also using the JS embed code]

    Posted 10 years ago #
  7. yuniar

    The closest thing I can find is by using this code:

    onload="javascript:this.scrollIntoView();"

    This would scroll the browser window right to the top of your form, not top of the page.
    However, it will do this on the first page load as well. I'm afraid I can't find any workaround for this yet. Sorry.


    MachForm Founder

    Posted 10 years ago #
  8. simonb
    Member

    I am not a php expert but can't this have an if / else statement determining the trigger say set by a cookie?
    Like

    if review page = 1 then onload="javascript:this.scrollIntoView();"
    else review page = 0

    Or it refreshes to the a name="#myForm"' section of the page
    ??

    This could also maybe be set for the Submission Confirmation page as it too gets lost amongst the scroll
    Some people after reload will never see it

    Posted 10 years ago #

RSS feed for this topic

Reply