What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    How can I solve an apparent problem with the "Dynamic Dropdowns" widget and javascript:history.back(1)?

    Asked by seveland on June 28, 2014 at 09:22 PM

    Hello

    I am Scott Eveland (user name 'seveland').

    A bit of Java script that has worked perfectly for years now fails, apparently in conjunction with your "Dynamic Dropdowns" widget (with I love, by the way).

    This form:

         form.jotformpro.com/form/41736958462971

    is embedded at:

         winkmeister.net/wms_rss_rpt_view9979.html

    On submission, conditions cause branches to one of these locations, depending on the selected widget field value:

         winkmeister.net/wms_rss_fox_nfl7952.html

         winkmeister.net/wms_rss_survivor_wiki9915.html

         winkmeister.net/wms_rss_fsu_rivals5988.html

         winkmeister.net/wms_rss_fox_titans5527.html

         winkmeister.net/wms_rss_fox_all_sports7878.html

    each of which has a button labeled "Back" which executes this command:

         javascript:history.back(1)

    which when pressed appears to return to the "view9979" location, but always "comes back".

    This is weird, and unprecedented.  Any ideas?

    dropdowns back button dynamic dropdown
  • Profile Image
    JotForm Support

    Answered by Welvin on June 29, 2014 at 01:50 AM

    Hi Scott,

    So the issue here is that when you click "Back" button to any of the result pages, it doesn't return to the original page which is:  winkmeister.net/wms_rss_rpt_view9979.html ? Am I correct? If yes, I've tested your form for several times and it seems to be working fine.

    Can you please explain further?

    Thanks

  • Profile Image

    Answered by seveland on July 01, 2014 at 12:06 AM


    Just to be clear, did you do the following:


    1    Navigate to:                           winkmeister.net/wms_rss_rpt_view9979.html

    2   From the menu, pick (e.g.):     ... FOX Titans

    3   Click the submit button:         "View selected report"

    4   Click                                     "Back"

    Then find yourself back at:    winkmeister.net/wms_rss_rpt_view9979.html?


    I suspected a Java problem (I use NoScript, version 2.6.8.31, in the Firefox browswer).

    Disabling NoScript did not fix the problem.

     

    I just asked my brother to take these steps at his house.  His "Back" failed as well.

     

    I am going to look at creating a hidden flag, setting as I depart the form/page (if possible) and see if I can get the browser to take me back to the RSS report selectionform.

  • Profile Image

    Answered by Jim_Rank on July 01, 2014 at 02:50 AM

    Hi Scott,

    We are sorry for the inconvenience caused to you.

    I have tested your website and could reproduce the problem.  Your form works perfect by direct link. See the following screenshot-

    but when I tested it from your website URL then it's showing the problem.

    It's not redirecting to your previous page by javascript:history.back(1), I'm sure a java-script conflicting in your webpage.

    You may use the direct link instead of using java-script code. As example, In your back button use winkmeister.net/wms_rss_rpt_view9979.html">Back .

    You may also try to re-embedding your form using iframe code. See the following guide-

    https://www.jotform.com/help/148-Getting-the-Form-iFrame-Code

    Hope this may helps. Please confirm us if the problem persists.

  • Profile Image

    Answered by seveland on July 06, 2014 at 09:39 PM

    Sorry, but this doesn't work.

    Explicit back-linking works BUT it resets the browser's "history queue".

    My security plan depends on people backing all the way back to their starting point.

     

    I will illustrate in this example:

    We have 3 pages (each containing a "Back" button using the Javascript):

    o Page 1 contains a forward link to Page 2

    o Page 2 contains a forward link to Page 3

     

    Step 1:             The user navigates to Page 1

    Step 2:             The user executes the link to Page 2

    Step 3:             The user executes the link to Page 3

    Step 4:             The user "backs" to Page 2

    Step 5:             The user "backs" to Page 1

     

    If we now replace the Page 3 back button with an explicit link to Page 2, the user, in Step 5, will return to Page 3 NOT Page 1 as desired.  You can find an example of this here:

    http://winkmeister.net/tform1.html

     

    I think I found the reason for this at this forum posting:

    http://www.jotform.com/answers/38744-Do-the-forms-automatically-clear-the-user-s-data-after-submission

     

    "The reason why the data you have entered are still there when you press the Back button in your browser is because BROWSERS AND HTML FORMS ACT THAT WAY. This is IMPLEMENTED AS A SAFEGUARD for when the user's internet connection is lost while submitting the form, so that you WON'T HAVE TO RE-FILL THE FIELDS …"

     

    [Emphasis is MINE]

     

    I WANT to re-fill forms, so the form will start "fresh" every time.  Seems like there ought to be a solution to this.

     

    Also:

    o Fiddling with flags did not work.

    o My test form IS in an  I-Frame.

     

    Thanks,

    Scott

  • Profile Image
    JotForm Support

    Answered by ashwin_d on July 07, 2014 at 01:55 AM

    Hello Scott,

    I did check your form and it seems to be working as expected. You seems to have added "history.back(1)" in your web page which should take you back to the previous page and it does work as expected. Please check the screenshot below:

    When you click on "View Selected Report", it is counted as a separate page and that may be the reason why you have to click twice on the "back" button to go to the page with dynamic dropdown page.

    Isn't that seems to work normally? Please explain your flow a little more in details if you want it to work in a different way.

    We will wait for your response.

    Thank you!

  • Profile Image

    Answered by seveland on July 07, 2014 at 10:11 PM

    1) For the first time tonight, I tried clicking repeatedly on "Back" and did in

       fact get back to the form.

       >> Repeated clicking on a button (what, do I provide a special instruction?)

             is not an acceptable operational mode.  A user would find it odd.  I find it odd.

    2) Then I clicked back at the form I returned to the originally-branched-to-page.

        >> When I click "Back" at the form, I expect to go back to where I branched

              TO the form in the first place.  This does not happen.

    I think I have shown NOT that invoking the Jotform redirect condition is flawed.  It is not.

    But, relying on the browser history queue to get you back clearly does not work.

    As for supplying more details, I am a lot a loss for words.  I have nothing else to explain as this situation is quite clear.

    I will find another way to get the job done.

  • Profile Image
    JotForm Support

    Answered by ashwin_d on July 07, 2014 at 11:33 PM

    Hello seveland,

    I believe that is how the "history.back" function works. It will take you one page back. You can test it by clicking on your browser back button and you will get the same result.

    Instead of "history.back", you can directly directly add a hyperlink URL to your "branched-to-page" URL in the back button. As per your previous response, you do not want to link direct URL to your page in back button but I believe that is the only reliable option available.

    Thank you!