function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Esther MercEsther Merc 

Error: The value of attribute "value" associated with an element type "apex:inputText" must not contain the '<' character.

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'));
     }
     
}
}






 
Best Answer chosen by Esther Merc
PriyaPriya (Salesforce Developers) 
Hi Esther,
1)Replace this  <apex:inputText label="Name" value="{!re.name"}/> with
 <apex:inputText label="Name" value="{!re.name}"/>
2)And this <apex:page Controller="NewRegistration">  sidebar="false"   showHeader= "false" with <apex:page Controller="NewRegistration"  sidebar="false"   showHeader= "false">

Hope this is helpful!
Kindly mark this as best answer.

Regards,
Ranjan
 

All Answers

PriyaPriya (Salesforce Developers) 
Hi Esther,
1)Replace this  <apex:inputText label="Name" value="{!re.name"}/> with
 <apex:inputText label="Name" value="{!re.name}"/>
2)And this <apex:page Controller="NewRegistration">  sidebar="false"   showHeader= "false" with <apex:page Controller="NewRegistration"  sidebar="false"   showHeader= "false">

Hope this is helpful!
Kindly mark this as best answer.

Regards,
Ranjan
 
This was selected as the best answer
mukesh guptamukesh gupta
Hi Esther,

Copy and Paste below code:
 
<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>
if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh 

 
Esther MercEsther Merc
Hi Priya,
Thanks , I fixed below as you said but I am getting this error: 
Error: RegistrationPage line 8, column 9: The content of elements must consist of well-formed character data or markup
Error: The content of elements must consist of well-formed character data or markup.



<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>
 
Esther MercEsther Merc
Hi Mukesh, Thanks for trying to help me
I put same code as you said but getting same error for below code.
Error: RegistrationPage line 2, column 1: Element type "apex:page" must be followed by either attribute specifications, ">" or "/>"
Error: Element type "apex:page" must be followed by either attribute specifications, ">" or "/>".


<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>

 
Esther MercEsther Merc
Hi Priya,
Below is the actual error in line 20 that I'm getting after writing as you told for below code

Error: RegistrationPage line 20, column 3: The markup in the document following the root element must be well-formed
Error: The markup in the document following the root element must be well-formed.


<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>

 
Esther MercEsther Merc
Priya and Mukesh,  Thank you for helping , your imput helped me. below is Visual force page , I changed a little but I bolded in Black what I changed that helped me for others to see.

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>