[play-2.4.x-Java] Form Validation using Jquery/javascript

55 de afișări
Accesați primul mesaj necitit

Abdullah hasan

necitită,
2 oct. 2015, 15:14:4602.10.2015
– play-framework
Hello I am new to Play framework . I have created a form page and handles the POST method . Now I want to add validation . I dont want to use Play Validation . I want to validate each input field by field , So that User can only submit if all the data in entered correctly.

I know how to do it in HTML form using bootstrap and jquery . How do i handle it in Play ? Just like normally i do in regular HTML or there are something that needs to be changed ??

thanks

Felipe Alfaville

necitită,
5 oct. 2015, 10:52:3705.10.2015
– play-framework

Erol Merdanović

necitită,
6 oct. 2015, 02:59:5306.10.2015
– play-framework
I see 2 ways:

1. You render the form with all the validation (html5 or some plugin). Good example is https://github.com/loicdescotte/Play2-HTML5Tags
2. You do the validation on the server (you will have to do it anyway) and when errors are returned (JSON) you just render them on the form.
Răspundeți tuturor
Răspundeți autorului
Redirecționați
0 mesaje noi