2 Replies Latest reply on Nov 3, 2008 6:48 PM by Nick Belaevski

    Selected Value in richPicklist using Java script.

    Anil Reddy Newbie

      Hi,

      I've the following <rich:Picklist> and I'm writing the javascript function to get the selected value from the picklist,I'm getting value of "undefined" .Please advise if any body has inputs.

      <rich:pickList id="categories" showButtonsLabel="false" switchByClick="false" targetListWidth="300Px"
      onclick="showSubCategory('subCategory', this)" sourceListWidth="300Px" listsHeight="120px" required="true">
      <f:selectItem itemLabel="Body Repair" itemValue="Body Repair"/>
      <f:selectItem itemLabel="Chrome and Plating" itemValue="Chrome and Plating"/>
      <f:selectItem itemLabel="Mechanical Services" itemValue="Mechanical Services"/>
      </rich:pickList>

      Javascript:
      <!--

      function showSubCategory (it, list) {
      var dropdownValue = document.getElementById('categories').value;
      alert("selectList11111 is .." + dropdownValue) ;
      var dropdownValue2 = (document.getElementById('categories').selectedIndex == 3)
      alert("selectList22222 is .." + dropdownValue2) ;
      var vis = (list.onclick) ? "block" : "none";
      document.getElementById(it).style.display = vis;
      } -->