+ Start a Discussion
srikanth julakantisrikanth julakanti 

Lowercase to Uppercase in VF page

How To Convert String Lowercase to Uppercase In Vf page
SaketJoshiSaketJoshi
1. You need a controller for that. You can use the toUpperCase() method over there
2. Do it using jQuery or javascript
praveen murugesanpraveen murugesan
Hi,

Here is the sample code.

Page:

<apex:page controller="LowerCase_to_UpperCase_Controller">
<apex:form >
Value <apex:inputText value="{!value}"/><br/>
lower<apex:outputText id="id1" value="{!lower}" /><br/>
upper<apex:outputText id="id2" value="{!upper}" /><br/>

<apex:commandButton action="{!change}" value="Change" reRender="id1,id2"/>
</apex:form>
</apex:page>

Controller:

public with sharing class LowerCase_to_UpperCase_Controller{
   
    public String value { get; set; }
    public String upper { get; set; }
    public String lower { get; set; }  
   

    public PageReference change() {
    upper = value.toUpperCase();
    lower = value.toLowerCase();
    
    return null;
    }    
      
}

Mark this as best answer if its helps.

Thanks.

Praveen Murugesan
Renan MoreiraRenan Moreira
You can actually use {!LOWER( stringvariable )} or {!UPPER( stringvariable )},