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
Rom_Rom_ 

Change text field from input field to output field if not blank after save

Hello, looking for a way to change a text input field on a Visualforce page to be displayed as an output field after something is entered in that field and save button is pressed. Or generally a way to make the field read-only once it is not null. Hoping to avoid using a controller. Any help much appreciated.
Best Answer chosen by Rom_
JethaJetha
You can achieve this functionality using 
<apex:inputField value="{!account.name}" rendered="{!If(account.name=null, true, false)}"/>
<apex:outputField value="{!account.name}" rendered="{!If(account.name!=null, true, false)}"/>