开发者

t:selectOneMenu how to get selected value using java script?

开发者 https://www.devze.com 2023-03-15 05:59 出处:网络
i want to get the select one menu using java script how can i get the selecteditemvalue? <h:outputLabel value=\"#{l.description1}\" styleClass=\"dataValue\" />

i want to get the select one menu using java script how can i get the selecteditem value?

<h:outputLabel value="#{l.description1}" styleClass="dataValue" />
<t:selectOneMenu id="choose开发者_JAVA百科LevelTypeId"
    value="#{AssetWizardComptTypeTile.levelTypeId}">
    <f:selectItem itemLabel="" itemValue="0" />
    <f:selectItems value="#{GeneralTables.levelTypesList}" />
    <a4j:support event="onchange" action="#{WizardMainControl.action}"
        ??oncomplete="if (document.getElementById('wizardForm:chooseLevelTypeId').selecteditem == 'somthing') 
        document.getElementById('wizardForm:a1').style.display = 'block';"
        reRender="chooseLevelTypeDesc" />
</t:selectOneMenu>


now get selectone menu item using javascript as

var selectedValue = document.getElementById("wizardForm:chooseLevelTypeId").value;

here selectedValue is your selected item.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号