
?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title>view</title>
<script type="text/javascript" >
function checkForm(){
if(document.form2["form2:uid"].value == ''){
alert("this field not blank");
return false;
}
if(document.form2["form2:uname"].value==''){
alert("enter name");
return false;
}
if(document.form2["form2:upassword"].value==''){
alert("enter password");
return false;
}
if(document.form2["form2:conform"].value==''){
alert("enter conform password");
return false;
}</p>
if(document.form2["form2:upassword"].value != document.form2["form2:conform"].value){
alert("password does not match");
return false;
}
if(! document.form2["form2:emailid"].value.match(/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/)){
alert("email not valid");
return false;
}
return true;
}
</script>
</h:head>
<h:body>
<f:view>
<h:form id="form2" onsubmit="return checkForm();">
<h1><h:outputText value="Create/Edit"/></h1>
<h:panelGrid columns="2">
<h:outputLabel value="Uid:" for="uid" />
<h:inputText id="uid" value="#{customerBean.customer.uid}" title="Uid" />
<h:outputLabel value="Uname:" for="uname" />
<h:inputText id="uname" value="#{customerBean.customer.uname}" title="Uname" />
<h:outputLabel value="Upassword:" for="upassword" />
<h:inputText id="upassword" value="#{customerBean.customer.upassword}" title="Upassword" />
<h:outputLabel value="conform:" for="conform" />
<h:inputText id="conform" value="#{customerBean.conform}" title="conform" />
<h:outputLabel value="Emailid:" for="emailid" />
<h:inputText id="emailid" value="#{customerBean.customer.emailid}" title="Emailid" />
</h:panelGrid>
<h:commandButton id="submit" value="create" action="#{customerBean.cusomerAdd}"/>
</h:form>
</f:view>
</h:body>
</html>