• Esther Merc
  • NEWBIE
  • 30 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 7
    Replies
Hi Guys , 
 After filling Registration form when Submit is clicked should be take to Welcome Page  and Information in Form should be saved to Registration__c  that I created

But got this Error
Error: RegistrationController Compile Error: Unexpected token ','. at line 25 column 65

Visualforce Page
apex:page controller = "RegistrationController">
 <apex:sectionHeader  title = "Registration Form" />
  <apex:form>
 
   <apex:pageBlock>
   <apex:pageBlockButtons location="bottom" >
     <apex:commandButton value="Submit"  action="{!WelcomePage}"/>
       
   </apex:pageBlockButtons>
   
   <apex:pageBlockSection>  collapsible = "false" columns="1">
      <apex:pageMessages>     </apex:pageMessages>
      <apex:inputText label="Name" value="{!reg.Name}" />
      <apex:inputText label="Username"  />
      <apex:inputSecret label="Password"   />
      <apex:inputSecret label="Confirm Password"   />
       <apex:inputText label="SecurityQuestion"    size="1">  />
        
         <apex:selectOptions>  
         value="{!SecurityQuestion}">
         </apex:selectOptions>
        
         </selectList>
         <apex:inputText label="Answer"/>
      
   
   
   </apex:pageBlockSection>
  </apex:pageblock>
 </apex:form>
 </apex:page>
 


Controller Class
ublic class RegistrationController {

Public pageReference  RedirectToLoginPage() {
     return null;
 }
 
 Public RegistrationController() {
       reg = new Registration__c();
       
 }
 
 public Registrationcontroller(ApexPages.StandardController controller) {
 
}


Public PageReference  RedirectToFinalPage() {
   pageReference  pg = new pageReference ('/apex/WelcomePage');
   return pg.setRedirect(true);
}
 
     
public pageReference   welcomePage(){
   if (string.isBlank (reg.Name__c)) {
       ApexPages.addMessage(new ApexPages.Message.severity.ERROR,'Enter Username!!'));
        return null;
     }
     
     insert reg;
       pageReference  pg = new pageReference ('/apex/WelcomePage');
   return pg.setRedirect(true);
   
 }


public pageReference loginPage(){
  pageReference  pg = new pageReference ('/apex/LogingPage');
   return pg.setRedirect(true);
 }
 
 public pageReference SignupPage() {
 
 
 pageReference pg = new pageReference ('/apex/LogingPage');
  return pg.setRedirect(true);

}


Public pageReference   resetPassword(){
    pageReference  pg = new pageReference ('/apex/ResetPasswordPage');
    return pg.setRedirect(true);
 }

Public Registration__c   reg {get;set;}

Public List<schema.PicklistEntry>
 getSecurityList= Registration__c.Security_Question__c.getDescribe().getPicklistValues();
       for(schema.PicklistEntry  securityQn : getSecurityList) {
           listSecurityQuestions.add(new  SelectOption(securityQn.getLabel()));

}
   Return listSecurityQuestions;

}

 Public  void  sendEmail() {
   Messaging.SingleEmailMessage eMailObj = new Messaging.SingleEmailMessage();

String[] ToAddress = new String []  {'esther@gmail.com '};
eMailObject.setToAddresses(ToAddress);

String subject = 'New Password';
eMailObject.setSubject(subject);
String mailBody = '<b> New Password was created <b>';

eMailObject.setHtmlBody(mailBody);

Messaging.sendEmail( new Messaging.SingleEmailMessage[]eMailObj});

   }

}
Hi Guys,

I have this page  which is showing no error in code but the Security Question picklist values is not showing the options from the custom Registration__c  object field named Security Questions which is a picklist.
Can you please help me.          Below is VF and Controller Class



VF
<apex:page Controller="NewRegistration"  sidebar="false"   showHeader="false">
<apex:sectionHeader title="Registration Page"/>
<apex:form >
<apex:pageBlock id="pg1" >
  <apex:pageMessages />
    <apex:pageBlockSection columns="1">
        <apex:inputText label="Name" value="{!reg.name}"/>
        <apex:inputText label="Username" value="{!reg.Username__c}"/>
        <apex:inputSecret label="Password" value="{!reg.Password__c}"/>
        <apex:inputSecret label="Confirm Password" value="{!reg.Confirm_Password__c}"/>
        <apex:selectlist label="Security Question" value="{!reg.Security_Question__c}"/>
        <apex:inputText label="Security Answer" value="{!reg.Security_Answer__c}"/>       
    </apex:pageBlockSection>
    <apex:pageBlockButtons >       
          <apex:commandButton value="Submit" action="!saveAction" reRender="pg1" />
    </apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>


Controller Class
public class NewRegistration {

  Public Registration__c  reg {get ; set;}
 
  public NewRegistration(){
         reg = new Registration__c ();
     }    
     
    public void saveAction(){
      system.debug ('saveAction inside' +reg);  
       
        insert reg;
        if (reg.name !=null) {        
        Apexpages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.INFO,'Registration Saved Successfully'));
     }
     
}
}



 
Hi! newbie here ..

I am trying to create a Visualforce Registration Page . But Iam getting Error: RegistrationPage line 8, column 9: The value of attribute "value" associated with an element type "apex:inputText" must not contain the '<' character. 

I created a registration sObject with all fields in VF page . When the Submit button is clicked , the registration information should be saved to the Registration sObject.

VF Page
<apex:page Controller="NewRegistration">  sidebar="false"   showHeader= "false"
<apex:form >
<apex:pageBlock id="pg1" >
  <apex:pageMessages  />
    <apex:pageBlockSection  columns="1">
     <apex:repeat> var=Re value="{!reg}"   </apex:repeat>
        <apex:inputText label="Name" value="{!re.name"}/>
       < apex:inputText label="Username" value="{!re.username__c}" />
        <apex:inputText label="Password" value="{!re.password__c}"/>
        <apex:inputText label="Confirm Password" value="{!re.confirm_password__c}"/>
        <apex:inputText label="Security Question" value="{!re.security_question__c}"/>
        <apex:inputText label="Security Answer" value="{!re.security_answer__c}"/>       
    </apex:pageBlockSection>
    <apex:pageBlockButtons>       
          <apex:commandButton value="Submit" action="!saveAction" reRender="pg1" />
    </apex:pageBlockButtons>
    
</apex:pageBlock>
</apex:form>
</apex:page>
</apex:page>




Controller Class
public class NewRegistration {

  Public Registration__c  reg {get ; set;}
 
  public NewRegistration(){
         reg = new Registration__c ();
     }    
     
    public void saveAction(){
      system.debug ('saveAction inside' +reg);  
       
        insert reg;
        if (reg.name !=null) {        
        Apexpages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.INFO,'Registration Saved Successfully'));
     }
     
}
}






 
Hi Guys , 
 After filling Registration form when Submit is clicked should be take to Welcome Page  and Information in Form should be saved to Registration__c  that I created

But got this Error
Error: RegistrationController Compile Error: Unexpected token ','. at line 25 column 65

Visualforce Page
apex:page controller = "RegistrationController">
 <apex:sectionHeader  title = "Registration Form" />
  <apex:form>
 
   <apex:pageBlock>
   <apex:pageBlockButtons location="bottom" >
     <apex:commandButton value="Submit"  action="{!WelcomePage}"/>
       
   </apex:pageBlockButtons>
   
   <apex:pageBlockSection>  collapsible = "false" columns="1">
      <apex:pageMessages>     </apex:pageMessages>
      <apex:inputText label="Name" value="{!reg.Name}" />
      <apex:inputText label="Username"  />
      <apex:inputSecret label="Password"   />
      <apex:inputSecret label="Confirm Password"   />
       <apex:inputText label="SecurityQuestion"    size="1">  />
        
         <apex:selectOptions>  
         value="{!SecurityQuestion}">
         </apex:selectOptions>
        
         </selectList>
         <apex:inputText label="Answer"/>
      
   
   
   </apex:pageBlockSection>
  </apex:pageblock>
 </apex:form>
 </apex:page>
 


Controller Class
ublic class RegistrationController {

Public pageReference  RedirectToLoginPage() {
     return null;
 }
 
 Public RegistrationController() {
       reg = new Registration__c();
       
 }
 
 public Registrationcontroller(ApexPages.StandardController controller) {
 
}


Public PageReference  RedirectToFinalPage() {
   pageReference  pg = new pageReference ('/apex/WelcomePage');
   return pg.setRedirect(true);
}
 
     
public pageReference   welcomePage(){
   if (string.isBlank (reg.Name__c)) {
       ApexPages.addMessage(new ApexPages.Message.severity.ERROR,'Enter Username!!'));
        return null;
     }
     
     insert reg;
       pageReference  pg = new pageReference ('/apex/WelcomePage');
   return pg.setRedirect(true);
   
 }


public pageReference loginPage(){
  pageReference  pg = new pageReference ('/apex/LogingPage');
   return pg.setRedirect(true);
 }
 
 public pageReference SignupPage() {
 
 
 pageReference pg = new pageReference ('/apex/LogingPage');
  return pg.setRedirect(true);

}


Public pageReference   resetPassword(){
    pageReference  pg = new pageReference ('/apex/ResetPasswordPage');
    return pg.setRedirect(true);
 }

Public Registration__c   reg {get;set;}

Public List<schema.PicklistEntry>
 getSecurityList= Registration__c.Security_Question__c.getDescribe().getPicklistValues();
       for(schema.PicklistEntry  securityQn : getSecurityList) {
           listSecurityQuestions.add(new  SelectOption(securityQn.getLabel()));

}
   Return listSecurityQuestions;

}

 Public  void  sendEmail() {
   Messaging.SingleEmailMessage eMailObj = new Messaging.SingleEmailMessage();

String[] ToAddress = new String []  {'esther@gmail.com '};
eMailObject.setToAddresses(ToAddress);

String subject = 'New Password';
eMailObject.setSubject(subject);
String mailBody = '<b> New Password was created <b>';

eMailObject.setHtmlBody(mailBody);

Messaging.sendEmail( new Messaging.SingleEmailMessage[]eMailObj});

   }

}
Hi! newbie here ..

I am trying to create a Visualforce Registration Page . But Iam getting Error: RegistrationPage line 8, column 9: The value of attribute "value" associated with an element type "apex:inputText" must not contain the '<' character. 

I created a registration sObject with all fields in VF page . When the Submit button is clicked , the registration information should be saved to the Registration sObject.

VF Page
<apex:page Controller="NewRegistration">  sidebar="false"   showHeader= "false"
<apex:form >
<apex:pageBlock id="pg1" >
  <apex:pageMessages  />
    <apex:pageBlockSection  columns="1">
     <apex:repeat> var=Re value="{!reg}"   </apex:repeat>
        <apex:inputText label="Name" value="{!re.name"}/>
       < apex:inputText label="Username" value="{!re.username__c}" />
        <apex:inputText label="Password" value="{!re.password__c}"/>
        <apex:inputText label="Confirm Password" value="{!re.confirm_password__c}"/>
        <apex:inputText label="Security Question" value="{!re.security_question__c}"/>
        <apex:inputText label="Security Answer" value="{!re.security_answer__c}"/>       
    </apex:pageBlockSection>
    <apex:pageBlockButtons>       
          <apex:commandButton value="Submit" action="!saveAction" reRender="pg1" />
    </apex:pageBlockButtons>
    
</apex:pageBlock>
</apex:form>
</apex:page>
</apex:page>




Controller Class
public class NewRegistration {

  Public Registration__c  reg {get ; set;}
 
  public NewRegistration(){
         reg = new Registration__c ();
     }    
     
    public void saveAction(){
      system.debug ('saveAction inside' +reg);  
       
        insert reg;
        if (reg.name !=null) {        
        Apexpages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.INFO,'Registration Saved Successfully'));
     }
     
}
}