user3506349
user3506349

Reputation: 9

JSF XHTML Registration Form Password Check

Im trying to create a Registartion form but i need the user to select and put their password in, then confirm their password.

How would i implement a check to see if these match and if they do stroe them in a RegsisteredBean.java file in a variable.

Im a complete beginner with JSF and XHTML.

Thanks

Upvotes: 0

Views: 1281

Answers (1)

Tiago Vieira Dos Santos
Tiago Vieira Dos Santos

Reputation: 1004

A simple and quick solution is actually done using the primefaces component as below (using the match attribute):

<h:outputLabel for="pwd1" value="Password 1: *" />  
<p:password id="pwd1" value="#{passwordBean.password5}" match="pwd2" label="Password 1" required="true"/>  

<h:outputLabel for="pwd2" value="Password 2: *" />  
<p:password id="pwd2" value="#{passwordBean.password5}" label="Password 2" required="true"/>  

Here's a link to the official showcase examples.

Upvotes: 1

Related Questions