Tagged: javascript, server-side, validation
- This topic has 2 replies, 2 voices, and was last updated 7 years, 6 months ago by
diegoliv.
-
AuthorPosts
-
-
August 8, 2014 at 2:21 pm #2179
diegolivMemberHi, Folks!
I’m starting to use Piklist and it’s awesome, but I have a question: is there any plans for integrating some sort of client-side validation to the fields created using the framework? As far as I know, there is server-side validation, which works ok, but I think that it would be most practical add to a client-side one too. This way, you don’t need to save/update a post and wait for a page reload to check if it’s everything ok.
Or there is at least a way to add a custom client-side validation?
Thanks for any answer or help!
-
August 8, 2014 at 3:08 pm #2181
KevinKeymaster@diegoliv-
First, thanks for the email, we will get back to you on the other items soon. As for your question, of course 🙂
So we include server side validation because its more secure and reliable, however you can add any client side improvements pretty easily. When defining the field just assign and classes or data attributes in the attributes parameter and you can use those to target those fields for the library of your choice. If you have one in mind and would like us to help you get started just let us know, we are here to help.
Thanks,
Kevin
PS We have already had users use this method to make select fields use the Chzn dropdowns and it was pretty easy.
-
August 8, 2014 at 4:55 pm #2187
diegolivMemberHi, @Kevin! That was quick! Thanks for the answer!
I agree with you that server-side validation is a lot more reliable. I’m just thinking about the usability of the field system generated by the framework.
You know, I’m used to set the Advanced Custom Fields plugin to build meta boxes. And when you set a required field, for example, and you go to a post and try to save it without fill the required field, the field is highlighted without a page reload. It would be awesome if we could reproduce this kind of behavior for Piklist, not just for required fields, but for validation too. As you pointed out, it’s possible to customize the fields and I’m comfortable with that, but a client-side validation built in the framework would be a good usability improvement for the system (its unobtrusive, as the system still would work without javascript using the server-side validation) and everyone using it (less work for devs and more awesomeness for end users). What do you guys think about this feature suggestion?
Thanks for the reply! I’ll look at some client-side validation libraries and if I have any question, I’ll be back here!
-
-
AuthorPosts
- You must be logged in to reply to this topic.