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
.Net Api.Net Api 

how to visable false the apex:inputtex when i select the selectlist item .

can u please tell me how to hide the apex:inputtext based on selectlist item values.

 

 

Afzal MohammadAfzal Mohammad

You may want to use rendered atrribute on inputtext component.

 

Your page would have code something like this.

 

 

<apex:selectList value="{!country}">
<apex:actionSupport event="onchange" rerender="fieldToRerender"/>
<apex:selectOptions value="{!countries}"/>
</apex:selectList>

<apex:inputfield id='fieldToRerender' value="{!contact.SOME_FIELD__C}" rendered="{!IF(country=='US',true,false)}"/>

 

Your controller class would have code, something like this.

 

public String country {set; get}

public List<SelectOption> getcountries() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('US','US'));
options.add(new SelectOption('CANADA','Canada'));
options.add(new SelectOption('MEXICO','Mexico'));
return options;
}

 

Hope that helps.

 

Afzal