You need to sign in to do that
Don't have an account?
Hiral Patel 25
showing error in this code
on this code showing error (Syntax error. Extra '1')
<apex:page>
<apex:form >
<apex:pageBlock title="CALCULATOR">
First Number: <apex:inputText value="{!First number}"/><br/><br/>
Second Number : <apex:inputText value="{! Second number}" /><br/><br/>
<apex:pageBlockButtons >
<apex:commandButton value="ADD" action="{!addition}" />
<apex:commandButton value="SUB" action="{!subtraction}" />
<apex:commandButton value="DIV" action="{!division}" />
<apex:commandButton value="MULTIPLY" action="{!multiplication}" />
</apex:pageBlockButtons>
<b>Output is:<apex:outputText value="{!result}"></apex:outputText></b>
</apex:pageBlock>
</apex:form>
</apex:page>
<apex:page>
<apex:form >
<apex:pageBlock title="CALCULATOR">
First Number: <apex:inputText value="{!First number}"/><br/><br/>
Second Number : <apex:inputText value="{! Second number}" /><br/><br/>
<apex:pageBlockButtons >
<apex:commandButton value="ADD" action="{!addition}" />
<apex:commandButton value="SUB" action="{!subtraction}" />
<apex:commandButton value="DIV" action="{!division}" />
<apex:commandButton value="MULTIPLY" action="{!multiplication}" />
</apex:pageBlockButtons>
<b>Output is:<apex:outputText value="{!result}"></apex:outputText></b>
</apex:pageBlock>
</apex:form>
</apex:page>
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.
The problem is with the following lines of code in your VF page
Try removing the space between {!First number} because that isn't the right way to use merge notation
I have tried this in my org and it gives me an Extra number error message
A good example is the following
Also, note that if you remove the space, you might see the following error which means there isn't any field referenced in the controller with this name
Let me know if this helps, if it does, please mark this answer as best so that others facing the same issue will find this information useful. Thank you