Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Where does format verification occur on a Form field
In relation to my trouble differentiating server side from client side in question http://vaadin.com/forum/-/message_boards/message/98010,
I would like to know how to tell vaadin to ensure password format verification occurs only on client side.
I have a form with fields and properties for username and password.
I set up password field to be secret, of course.
I set up the verification for password to be
at least 2 uppercase
at least 2 lowercase
at least 2 numbers
at least 2 special chars
I want the verification to be done only on the client side, because i don't want the password to be passed back and forth the network as many times as a user did not satisfy the verification criteria.
Is there a way to tell vaadin to ensure verification of secret fields in a form, whether passwords or otherwise, is not done on the server?
This question is related to my question in 98010 - how to differentiate in a vaadin class, what is being done on the server and what is being done on the client.
If you want client-side validation of password format, you could use my client-side validated TextField. I just noticed that the setSecret(true) did not work for it because it actually requires another client-side component for some technical reasons. So, I added a CSValidatedPasswordField, which should work.
You can try it with the demo. Select the "Password" example in the menu.
Notice that the component does not actually prevent submitting invalid passwords, as the user can move out of the input field (and click a submit button) even when the input is invalid. This client-side validation is just for informational purpose to the user and you need to validate the password on the server-side anyhow.
blessed r geek: Thx.
You can do the client-side validation of a password format with GWT just as well. You can see the VCSValidatedTextField for an example of doing client-side validation. If you use the Eclipse plugin to create the component stub, it's a somewhat simple task.
The root DOM element of a password text field has to be initialized with DOM.createInputPassword(), as done in VCSValidatedPasswordField.