최근 검색
최근 검색 없음
Error handling in Guide request forms
답변함
2022년 5월 27일에 게시됨
Hello there,
I'm looking for some ideas on how to approach error handling while creating a new request form inside the help center. Currently when the user submits a new request with errors on a specific form (domain.com/hc/en/requests/new?ticket_form_id=...), the form will be redirected to domain.com/hc/en/requests showing the different field errors. However, I would like to have this feature of error handling inside the ticket form and avoid this redirection to other page. This is because im executing specific javascript just for one particular form id, so Im looking for an elegant idea on how to solve this approach.
Thank you !
1
1
댓글 1개
Greg Katechis
Hi Carlos! Requests that are sent from our ticket form have to go upstream for validation. As such, we don't expose the errors in the response. That said, here's an idea that you could test out...
For each of the fields that you need to validate on the form, find their unique class (see screenshot) and build out the validating regex to meet your criteria. If any of the fields do not meet your criteria, keep the submit button in a disabled state. Once the criteria are met, remove the disabled attribute from the submit button.
This definitely isn't elegant, but the nature of the way we handle requests here makes this difficult to otherwise work through. If anyone else in the community has a more elegant solution, please share it with us!
1
댓글을 남기려면 로그인하세요.