0

I am getting the error Element type "apex:inputText" must be followed by either attribute specifications, ">" or "/>". when using <apex:inputText>.

VF Markup

<apex:page controller="awardsClassExperiment" lightningStyleSheets="true">
<apex:form>
    <apex:pageBlock>
    <!--Add scholarship to pageBlockTable-->
    <apex:pageBlockButtons>
      <apex:commandButton action="{!add_recipient}" value="Add Recipient"/>
    </apex:pageBlockButtons>

    <!-- User inputs fields -->
    <apex:inputText value="{!currentSubmission.recipient.Name"} label="First Name"/>
    <apex:inputText value="{!currentSubmission.recipient.Last_Name__c"} label ="Last Name"/>
    <apex:inputText value="{!currentSubmission.recipient.School__c}" label="School"/>
    <apex:inputText value="{!currentSubmission.Specialty__c"} label="Specialty"/>
    <apex:inputText value="{!currentSubmission.scholarship.Award__c"} label="Award"/>

    </apex:pageBlock>
    
    <!-- Record List-->
    <apex:pageBlock title="Your Added Scholarships">
        <apex:pageBlockTable> id="Recipients" value="{!Submissions}" var="Recipient">
            <apex:column headerValue="First Name" value="{!Recipient.Recipient.Name}"/>
            <apex:column headerValue="Last Name" value="{!Recipient.Recipient.Last_Name__c}"/>
            <apex:column headerValue="School__c" value="{!Recipient.Recipient.School__c}"/>
            <apex:column headerValue="Award" value="{!Recipient.Scholarship.Award__c}"/>

        </apexPageBlockTable>
    </apex:pageBlock>

</apex:form>
</apex:page>

I am not sure what is the issue here as I used < and /> for all <apex:inputText> tags.

3
  • 2
    Looks to me like you have several close curly braces outside of the quoted attribute value. Like value="{!currentSubmission.recipient.Last_Name__c"}. Is that a typo, or does it really exist in your visualforce page?
    – Derek F
    Commented Oct 19, 2020 at 17:40
  • 1
    @DerekF You should add that answer, it is most likely correct.
    – sfdcfox
    Commented Oct 19, 2020 at 17:43
  • Nice catch. Thanks. Wrote this in VS so didn't notice it Commented Oct 19, 2020 at 17:43

1 Answer 1

1

Looks to me like there are issues in your merge syntax here.

I count 3 locations where the closing curly bracket comes after the closing quote

<apex:inputText value="{!currentSubmission.recipient.Name"} label="First Name"/>
<apex:inputText value="{!currentSubmission.recipient.Last_Name__c"} label ="Last Name"/> <!-- first instance -->
<apex:inputText value="{!currentSubmission.recipient.School__c}" label="School"/>
<apex:inputText value="{!currentSubmission.Specialty__c"} label="Specialty"/> <!-- second instance -->
<apex:inputText value="{!currentSubmission.scholarship.Award__c"} label="Award"/> <!-- third instance -->

The entire merge expression should be contained in the attribute value (enclosed by quotes).

i.e. value="{!expression"} is wrong, and value="{!expression}" is right.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .