Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top