-1

I am using a controlling and dependent picklist on vf page. Dependent picklist is a multislect picklist. When i select value in chosen column of dependent picklist and change the value in controlling picklist the chosen value is not getting nullified. For this i removed the action support from the controlling picklist and my problem was solved. But now for the None value in controlling picklist the dependent picklist is getting rendered on the page. Is there any way to hide dependent picklist on the basis of selection in the controlling picklist through javascript or something?

  • 1
    Can you please share what you have tried till now? – Saroj Bera Sep 5 '15 at 2:21
  • i tried hiding the field on the basis of plv in the controlling field using java script but found out that it cannot be done if fields are dependent. I also nullified the field for the values of controlling field where i didn't wanted the dependent pick list to render but nothing worked. – Nitesh Sep 8 '15 at 6:26
1

you can use jQuery to do this easily. Make sure you use $j=jQuery.noConflict(). Assign an ID to your fields and then you can use logic to show/hide based on response. Essentially as below:

if($j("#id").val('picklistVal') == 'value')){
    $j("#id_to_hide").css("display","none");
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.