Búsquedas recientes
No hay búsquedas recientes
Custom JS gets disabled upon hitting Submit on the form when there are issues with input fields
Publicado 03 nov 2023
I have a form in my ZenDesk to which I have applied various custom Javascript/jQuery via the theme's script.js file. It works fine until I submit the form and there is some problem with it, like mandatory fields not filled out.
The page reloads and the mandatory fields get messages underneath in red like "cannot be blank", however all of the custom JS in script.js also gets disabled. What is the cause of this, and can it be prevented? Otherwise it breaks a lot of functionality, if someone submits the form, and then fields are missing, the form refreshes but anything custom in script.js is no longer functional.
1
1
1 comentario
Mark
It seems this is due to the fact that the URL changes when the form is submitted with errors (the deeplink is disabled).
For example, if your form is at: https://myzendesksite.com/hc/en-us/requests/new?ticket_form_id=19783334084635
And you submit the form, the deeplink gets reset, and you are redirected to:
https://myzendesksite.com/hc/en-us/requests
Although the same form is still selected by default.
So I guess the real question is... Why does this behaviour occur during form submission when errors/missing mandatory fields are present? This breaks certain functionality when a user has implemented custom javascript that checks the ticket form ID before applying the custom js.
1
Iniciar sesión para dejar un comentario.