Add custom validation rules

  • edo.m
    Asked on February 15, 2021 at 6:24 AM

    Hi,

    is it possible to create custom validation rules?

    Preferably via JS (I will host the source code).


    Would be happy if there is a method where i can toggle the validated state.

    found how to trigger an error (JotForm.errored(input, message), but the form validity was not updated

  • Cecile JotForm Support
    Replied on February 15, 2021 at 7:34 AM

    Hello there,

    I suggest you to download your form's full source code. Then, you can add your custom validation rules via JS.

    Guide: How-to-get-the-full-source-code-of-your-form

    Should you have any other concerns, kindly let us know.

    Thank you.

  • edo.m
    Replied on February 15, 2021 at 7:47 AM

    Thanks,

    how can i hook the validation rules to the form?

    i.e, prevent the submission event when invalid. Trigger the validtion check when submit button is clicked...

  • Jovanne JotForm Support
    Replied on February 15, 2021 at 8:19 AM

    Hi,

    As my colleague suggested, the only way to insert your own custom JS validation into the form is by downloading the form source code. This way, you can freely modify the form source code and insert your own.

    Modification and customization of form source code are beyond our support scope. This workaround is quite tricky, so I would suggest you look for a web developer that can help you with your requirements.

    We do have verification widgets that you might want to use. Please check this link. Here's a guide on How-to-Add-a-Widget-to-Your-Form.

    If there are specific features you're looking for, we can submit that as a feature request but note that requests have priorities depending on the no. of users requesting them.

    Let us know if you have further questions.

  • edo.m
    Replied on February 15, 2021 at 8:29 AM

    Thanks,

    I am the web developer...

    Do you have any developer documentation on how i would hook my functions to the form object created with jotforms{JotForm}?

    Is it possible to create our own widgets?

  • Gaetan_B
    Replied on February 15, 2021 at 8:53 AM

    Hello,

    Please find all the developer's documentation we have on the following pages.

    General: https://www.jotform.com/developers/

    Node specific: https://www.jotform.com/developers/libraries/#jotform-api-nodejs


    Hope this helps.

    Do not hesitate to reach out again should you have any further inquiries.


  • edo.m
    Replied on February 15, 2021 at 9:00 AM

    Thanks,

    those are great for interacting with your backend.

    hoped to find some documentation for the actual form object