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
Satya BandiSatya Bandi 

Is it possible to view or hide a field based on the picklist selection of two other fields on a VF Page. Please let me know.

Akshit HuriaAkshit Huria
Hi satya Bandi

yes it is possible, Please refer below code snippet
 
<head>
	
<!--Script-->
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"/>
	<script>
    function jsFunction()
    {
	    var dropdownValue = $("[id$='seleclst']").val();
	    if(dropdownValue == "valueA")	//Lets suppose a value.
	    {
		    $("[id$='btn']").hide();
	    }
    }
	</script>
</head>

<!--vf page snippet-->
<apex:selectList id="seleclst" required="true" size="1" value="{!aval}" onchange  = "jsFunction(); return false;" >
                  <apex:selectOptions value="{!aname}" />
</apex:selectList>
<apex:CommandButton id="btn" value="action Button" />

Please let me know if above code snippet hepls you

Thank You
Akshit