Stop the redirection after Submit a Request form is submited ? | Community
Skip to main content

Stop the redirection after Submit a Request form is submited ?

  • January 28, 2023
  • 5 replies
  • 0 views

Ronit12

Hi There,

I am stuck here, hope somebody can help me with this :) I want to stop the redirection when someone submits a form from the Submit a request page.

Instead of redirecting I just want to show a Simple popup.

 

Thanks In Advance

5 replies

Eric27
  • January 30, 2023
Hey Ronit,
 
You could use the onbeforeunload html event to accomplish this. Related docs can be found here.

Thanks!

Ronit12
  • Author
  • January 31, 2023

Hi Eric

Thanks for checking in, I am beginner level in coding so if you don’t mind can you please let me know where I have to use the above html attribute you have shared in Zendesk theme

Thank you


Eric27
  • January 31, 2023
Hi Ronit,

You'd want to put this in the new_request_page.hbs if you're not wanting them to leave the page after submitting a request form. 

Ronit12
  • Author
  • January 31, 2023

Hey Eric
I have used the attribute you have provided but it shows the default pop up which we can’t update there text.

Want I want to achieve that if some one submit the form on success I want to show the Custom Popup instead of redirect

Thank You


Eric27
  • January 31, 2023
Hey Ronit,

Apologies Ronit I assumed you knew about the restriction. Modern browsers no longer allow you to modification of the popup for beforeunload. Unfortunately I'm not aware of any events that we expose that could pause the page redirect other than this to allow you to show a popup. 
 
Sorry for the inconvenience.