开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜