Client-side validation

Client-side validation

TomB2015TomB2015 Posts: 19Questions: 6Answers: 0

Hi Allan,

I'm currently performing validation of my data at the server-side but was wondering what options are available for client-side validation?

Note I'm aware of the field 'attr' option to apply HTML5 attributes (such as placeholder and maxlength) but this is obviously quite basic.

Regards,
Tom

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Hi Tom,

    Currently for client-side validation you need to use the preSubmit event like in this example.

    I have explored the option of providing a validator method for fields on the client-side and I plan to introduce that in a future version, but I had been hoping to provide a function that would match the signature used by existing validation libraries. Unfortunately most of them do a lot more than simply validating data, so likely some work will be needed there - possibly forking one of the existing libraries to generalise it.

    At the moment Editor focusing primarily on server-side validation is it must be done there.

    Allan

  • TomB2015TomB2015 Posts: 19Questions: 6Answers: 0

    Thanks for the response Allan.

    Could you let me know when this facility would be added as this would be key functionality for us?

    Could we use the preSubmit event in any case?

    Regards,
    Tom

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Yes you can use preSubmit at the moment and will be able to do so in future as well.

    Using custom client-side validators is not a feature that is planned for the next major release, but possibly the one after that, so it is some months away (I can't give an exact time frame as I don't have one just now).

    Allan

This discussion has been closed.