0

I have Sitecore form which shows thank you message as a popup. So once form is submitted and when user again tries to open the form(2nd time after submitting successfully) by clicking on form link it directly shows the thank you message popup. How to handle this?

4
  • Are you using any custom JS code to show Thankyou message in popup? Commented Feb 21, 2023 at 14:49
  • No just using Multipage form and showing next page i.e thankyou page on form submit as popup.
    – Vikram
    Commented Feb 21, 2023 at 15:08
  • This is the behavior to show form with a Modal window. because form DOM is on parent windows, based on user input, that DOM is updated with an input value and shows hide pages. so Until you did not write javascript code to reload parent windows or reset HTML. you will get this behavior. Commented Feb 21, 2023 at 15:20
  • @Vikram After submitting the page, when you click on the link to open the form, so is it not refreshing the browser? Commented Feb 21, 2023 at 15:31

1 Answer 1

0

This is the behavior to show form with a Modal window. because form DOM is on parent windows, based on user input, that DOM is updated with an input value and shows hide pages. so Until you did not write JavaScript code to reload parent windows or reset HTML. you will get this behavior.

You can write javascript method on modal window close button click and modal focus out, as below example.

 $('#myModal').on('hidden.bs.modal', function () { $('#myModal form')[0].reset(); }); 
4
  • I want to avoid page reload. Can you please clarify on HTML reset . how it can be achieved.
    – Vikram
    Commented Feb 22, 2023 at 6:35
  • Need to write Javascript, on modal window close button click or on focus out from the modal container, you can reset form fields and also set page container div visibility to default. ```` $("#myModal").modal("show"); $('#myModal').on('hidden.bs.modal', function () { $('#myModal form')[0].reset(); }); ```` Commented Feb 22, 2023 at 6:59
  • Can you please provide more details on div visibility. form reset is fine but it reset the current page only.
    – Vikram
    Commented Feb 24, 2023 at 14:04
  • I assume the "Thank You Message" popup is configured in second Page Item of Sitecore Form. If so you can add a dummy submit button without providing any Submit Actions in the Thank You Page Item and please trigger the submit via JS. Once the submit is triggered a new form will be automatically generated
    – Sylesh JL
    Commented Mar 19 at 5:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.