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
vinothvinoth 

InputText tag in StandardController -VisualForce Page

Is there any possibilities to use inputText tag when we use 'StandardController ’ in  visualForce page? If so, how to save the values which is inputText? Do I need to write/override save button functionality to achieve this?  

Navatar_DbSupNavatar_DbSup

Hi,

 

Try the below code snippet as reference:

 

<apex:page standardController="Contact">

 <html>

<apex:form >

 <table  width="100%">

 <tr>

 <td><b>Contact Edit</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

 <apex:commandButton value="Save" action="{!save}"/>

 </td>

 </tr>

 <tr>

<td colspan="2" style="background-color:Thistle ;"><b>Contact Information</b>

</td>

 </tr>

 <tr>

 <td colspan="1"><apex:outputlabel >First Name</apex:outputlabel>

  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<apex:inputField value="{!contact.firstname}"/>

</td>

 <td><apex:outputLabel >Last Name</apex:outputLabel>

  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

 <apex:inputText value="{!contact.lastname}"/></td>

 

</tr>

  <tr>

  <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

 <apex:commandButton value="Save" action="{!save}"/>

 </td>

  </tr>

 

 

</table>

</apex:form>

</html>

</apex:page>

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

 

 

vinothvinoth

Thanks,

 

If i get values from 'extensions' class, how can i save that value? will that code work for that case?

 

<apex:inputText id="op" value="{!selectedOptions}"  style="vertical-align:top;"/>