Automatically shows the Choose file Option / Button when a checkbox is selected.

whenever I select/check the checkbox (checkbox value=true) then the ChooseFile (inputfile) should display/show automatically .

Vf code:

<apex:page controller="example23">

<apex:form >

 <apex:inputCheckbox value="{!option}" >
<apex:actionsupport event="onclick" action="{!change}" />

<apex:actionRegion rendered="{!bool}">

<apex:inputFile value="AttachFile" />



Apex Controller:

public class example23 {

 public Boolean bool { get; set; }
 public Boolean option { get; set; }
 public PageReference change() {
 if(option == true)
 bool = true; 
 bool = false; 
 return null;

public example23(){
bool =false;


To hide  tag


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s