最近搜索


没有最近搜索

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 条评论

      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


      登录以发表评论。

      找不到所需的内容?

      新建帖子