You need to sign in to do that
Don't have an account?
javascript to hide theapex input text field
hello all,
I am tryingto hide an input text field for a picklist value and show the same field for another picklistvalue. I want to get this function through javascript. I am trying to avoid hte usage of "getElementById". I could get this working on the vf attribute "styleclass". But i want to call the script from the attribute "id".
Here is my code.
<apex:inputText value="{!ConEmail.dealerCode}" id="DealerCode">
here is javascript :
<script> function EventChanged(leadFormat) { if (leadFormat.value == "XML-GM" ) { $("#DealerCode").show(); alert('IN IF'); } else { $("#DealerCode").hide(); alert('IN ELSE'); } } </script>
I can enter the if condition and get the alerts for "in if" and "in else" but somehow unable to hide or show the field.
Any input will be greatly appreciated.
<apex:inputText value="{!ConEmail.dealerCode}" id="DealerCode">
Just check whether you missed any one of the steps mentioned in the knowledge base:
http://developer.force.com/cookbook/recipe/using-jquery-in-a-visualforce-page
--yvk