+ Start a Discussion

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_
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)}"/>