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
aaryansriaaryansri 

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


Suppose I have one checkbox and one inputfile (Choose File). 
The idea is whenever I select/check the checkbox (checkbox value=true) then the ChooseFile (inputfile) will be automatically displayed in my visualforce page. 
Please Help me for this scenario, I've got the following page code & controller code but it doesn't seem to be working.
<apex:inputCheckbox value="{!option}" > <apex:actionsupport event="onclick" action="{!change}" reRender="pg"/> </apex:inputCheckbox> <apex:inputFile value="AttachFile" rendered="{!bool}"/> public Boolean option {get;set;} public Boolean bool {get;set;} public extHospitals(){ bool = false; } public void change() { if(option == true){ bool = true; } else { bool = false; } }when i'm executing this code i'm getting this Error..
Visualforce Error:  
apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a rerender or oncomplete attribute.

Is there any solution to achieve this type of scenario