You need to sign in to do that
Don't have an account?
Want to hide a picklist field Using JQuery.
I m trying to hide a picklist field in below Sample code:
<apex:page showheader="true" standardController="Merchandise__c">
<head>
<apex:includeScript value="{!$Resource.JqueryMin}" />
<script>
$j = jQuery.noConflict();
$j(document).ready(function() {
$j("#hide").click(function(){
$j("#inpi").fadeOut('slow');
});
$j("#show").click(function(){
$j("p").show();
});
});
</script>
</head>
<body>
<apex:form >
<div id="inpi">
<apex:inputField value="{!Merchandise__c.PickList1__c}" />
</div>
<p>If you click on the "Hide" button, I will disappear.</p>
<button id="hide">Hide</button>
<button id="show">Show</button>
</apex:form>
</body>
</apex:page>
When I click on hide button, it hide that field for a movement and again it appears automatically.
I think the page is getting refreshed or something else
Please provide me the solution.
<apex:page showheader="true" standardController="Merchandise__c">
<head>
<apex:includeScript value="{!$Resource.JqueryMin}" />
<script>
$j = jQuery.noConflict();
$j(document).ready(function() {
$j("#hide").click(function(){
$j("#inpi").fadeOut('slow');
});
$j("#show").click(function(){
$j("p").show();
});
});
</script>
</head>
<body>
<apex:form >
<div id="inpi">
<apex:inputField value="{!Merchandise__c.PickList1__c}" />
</div>
<p>If you click on the "Hide" button, I will disappear.</p>
<button id="hide">Hide</button>
<button id="show">Show</button>
</apex:form>
</body>
</apex:page>
When I click on hide button, it hide that field for a movement and again it appears automatically.
I think the page is getting refreshed or something else
Please provide me the solution.
Can you try the below code,
Mark this as a solution, if this helpful to you..!