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
Naresh Kumar Mohan ThirukkovaluruNaresh Kumar Mohan Thirukkovaluru 

can anyone tell me vf code & controller class code for calculator with single input text

<apex:page controller="calc" >
  <apex:form >
  <apex:pageBlock >
  <table border="1">
   <apex:inputText size="11"/>
   <tr><td><apex:commandButton value="9" /></td><td><apex:commandButton value="8"/></td><td><apex:commandButton value="7"/></td><td><apex:commandButton value="/"/></td></tr>
   <tr><td><apex:commandButton value="6"/></td><td><apex:commandButton value="5"/></td><td><apex:commandButton value="4"/></td><td><apex:commandButton value="*"/></td></tr>
   <tr><td><apex:commandButton value="3"/></td><td><apex:commandButton value="2"/></td><td><apex:commandButton value="1"/></td><td><apex:commandButton value="+"/></td></tr>
   <tr><td><apex:commandButton value="0"/></td><td><apex:commandButton value="."/></td><td><apex:commandButton value="-"/></td><td><apex:commandButton value="%"/></td></tr>
</table>
</apex:pageBlock>
</apex:form> 
</apex:page>
Kathir DevanKathir Devan
Hi Naresh,

try this

page:

<apex:page controller="calc" >
  <apex:form >
  <apex:pageBlock >
  <table border="1">
   <apex:inputText size="11"/>
   <tr><td><apex:commandButton value="9" /></td><td><apex:commandButton value="8"/></td><td><apex:commandButton value="7"/></td><td><apex:commandButton value="/"/></td></tr>
  </table>
</apex:pageBlock>
</apex:form>
</apex:page>

class:

public with sharing class calc {
}