Escolar Documentos
Profissional Documentos
Cultura Documentos
<script type="text/javascript">
function validate() {
var x = document.getElementById("j_id0:j_id2:firstname");
var y = document.getElementById("j_id0:j_id2:password");
var z = document.getElementById("j_id0:j_id2:lastname");
var w = document.getElementById("j_id0:j_id2:email");
var u = document.getElementById("j_id0:j_id2:Uname");
var a = document.getElementById("j_id0:j_id2:cpassword");
var atpos = w.value.indexOf("@");
var dotpos = w.value.lastIndexOf(".");
if (x.value.length == 0) { alert("Enter the First Name\n");return false;}
else if (z.value.length == 0) { alert("Enter the Last Name\n");return false; }
else if (w.value.length == 0) { alert("Enter the Email\n");return false; }
else if (atpos<1 || dotpos<atpos+2 || dotpos+2>=w.value.length)
{
alert("Not a valid e-mail address");
return false;
}
else if
else if
else if
se; }
else if
else if
else if
else {
return true;
}
}
</script>
<apex:form >
<html>
<body>
<apex:outputPanel style="color:#3b5999;">
<apex:panelGrid columns="2" style="margin-top:1em;color:#3b5999;"> <p>&n
bsp; &nbs
p;
<b>*First Name:</b><br/>
<apex:inputText id="firstname" value="{!firstname}" style="height:22px;w
idth:235px;"/>
</p><p>  
;
<b>*Last Name:</b><br/>
<apex:inputText id="lastname" value="{!lastname}" style="height:22px;wid
th:235px;"/>
</p><p>  
;
<b>*Your Email:</b><br/>
<apex:inputText id="email" value="{!email}" style="height:22px;width:235
px;" title="Enter the email with which you can login"/>
</p><p>  
;
<b>Gender</b><br/>
<apex:selectRadio value="{!gender}" >
<apex:selectOptions value="{!options}" id="gender"/>
</apex:selectRadio></p><p> &nbs
p;
<b>Security Question</b><br/>
<apex:selectList multiselect="false" size="1" value="{!question}" >
<apex:selectOptions value="{!options1}" id="qus"/>
</apex:selectList>
</p><p>
<b>*Answer:</b><br/>
<apex:inputText id="ans" value="{!answer}" style="height:22px;width:235p
x;">
</apex:inputText>
</p> <p> &nbs
p;
<b>*User Name:</b><br/>
<apex:inputText id="Uname" value="{!username}" style="height:22px;width:
235px;">
<!--<apex:actionFunction name="showerror" action="{!show}"/>-->
</apex:inputText>
</p> <p> &nbs
p;
<b>*Password:</b><br/>
<apex:inputSecret id="password" value="{!password}" style="height:22px;w
idth:235px;"/>
<b>*Confirm Password:</b><br/>
<apex:inputSecret id="cpassword" value="{!cpassword}" style="height:22px
;width:235px;"/>
</p><b><apex:commandButton action="{!registerUser1}" title="Register" va
lue="Sign Up" style="color:white;background:red;" onclick="return validate()" />
</b>
</apex:panelGrid>
<apex:messages style="color:green"/>
</apex:outputPanel>
</body>
</html>
</apex:form>
</apex:page>
----------------------------------------------------------------------------->
public class Registrationfunc {
public String username {get; set;}
public String password {get; set {password = value == null ? value : value.t
rim(); } }
public String cpassword {get; set {password = value == null ? value : value.
trim(); } }
public UserInfo__c userlogin {get; set;}
public String firstname {get; set;}
public String lastname {get; set;}
public String email {get; set;}
public String gender {get; set;}
userlogin.Question__c = question;
userlogin.Answer__c = answer;
userlogin.UserId__c = username ;
// Use generateAesKey to generate the private key
userlogin.Password__c = password;
// userlogin.Confirm_Passsword__c = cpassword;
insert userlogin;
PageReference nextpage = new PageReference('/apex/login');
return nextpage;
}
}
----------------------------------------------------------------------------------------------->
<apex:page controller="Passwordforgot" showHeader="false" >
<apex:form >
<center><br/><br/><br/><br/><br/>
<apex:outputPanel >
<apex:panelGrid columns="2">
<p><b>Enter UserName</b>
<apex:inputText value="{!username}"/></p>
<apex:outputPanel rendered="{!display}">
<p><b>Your Question <br/>
<apex:outputField value="{!userInfo.Question__c}"/> </b></p>
<p><b>Answer</b>
<apex:inputText value="{!answer}"/></p>
</apex:outputPanel>
</apex:panelGrid>
<apex:commandButton value="Confirm" action="{!ShowQuestion}" rendered="
{!asish != 'hii'}"/>
<apex:commandButton value="Ok" action="{!RetrievePassword}" rendered="{
!asish=='hii'}"/>
</apex:outputPanel>
<apex:outputPanel rendered="{!visible=='hii'}">
<b>Your Password is sent to </b>{!userInfo1.Email__c}<br/>Please check
your mail
</apex:outputPanel>
<apex:messages style="clor:blue" />
</center>
</apex:form>
</apex:page>
-------------------------------------------------------------------------------------------------------->
public class Passwordforgot {
// private final Login__c log;
public String username{get;set;}
public String question{get;set;}
public String answer{get;set;}