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
Radhika pawar 5Radhika pawar 5 

using rendered ,I want to hide text fields once checkbox is checked

Hi Group,

I have one requirement in VF page, I want to hide input fields (TextFields) once i m clicked on checkbox.

Example:-there is camp1 date and 1 checkbox.
once i m selecting checkbox  then my camp1 date input fields will be hidden.
I know this is possible using javasript but i want to use rendered .

so please guide me .
Mani RenusMani Renus
VF

<apex:inputCheckbox value="{!account.Checkbox}" >
<apex:actionSupport event="onchange" rerender="Fieldrender" action="{!Fieldupdate}"/>
</apex:inputCheckbox>

<apex:intputfield value="{!account.DateField__c}"  rendered="{!field}" id="Fieldrender"/>


Controller

Public constructor() {
    field=true;
}

public void Fieldupdate{
     if(account.Checkbox__c==true){
           field=false;
     }else{
            field=true;
      }
}

Regards,
Mani