You need to sign in to do that
Don't have an account?
madhu_ra
Deselect item from apex:inputField with JQuery
I have an apex:inputField in my visualforce page. It is populated with a picklist field of a standard object.
<apex:inputField id="practiceselection" value="{!PracticeOpportunity.myPickList__c}" onchange="myOnchangeFunction(this);" ></apex:inputField>
There is one item in this picklist which is the default value. I need to deselect that default item from the component whenever user select one from the list. I tried to do this with JQuery but could not able to overcome.
This is what I tried finally. When user select more than one with the default value, I tried to deselect all options.
$('#practiceselection').val([]);
But this didn't work. Please give an idea to implement this.
Thanks & Regards,
Madhura
To select a vf component with jquery try this
SF generates Id based on its own algorithm something like "jd1:jdf01:jdf0001:practiceselection" so normal id selector wont work but you can use ends with selector