开发者

How to get a Javascript Chained Menu Output Values of Selected Drop Downs after Submitting Form?

开发者 https://www.devze.com 2023-02-07 00:43 出处:网络
开发者_JS百科I am using this script Dynamic Drive Chained Menu and what I am trying to do is when someone clicks the \"go\" button the values of the selections made display in a text box with a messag

开发者_JS百科I am using this script Dynamic Drive Chained Menu and what I am trying to do is when someone clicks the "go" button the values of the selections made display in a text box with a message that says something like "You have selected:"


I've changed the main part, from the alert is up to you :)

function goListGroup(){
    var options = [];
    for (i=0;i<arguments.length; i++){
        if (arguments[i].selectedIndex!=-1){
            options.push(arguments[i].options[arguments[i].selectedIndex].value);
        }
    }
    alert(options);
}

Don't forget to set the value attribute on the option element!

0

精彩评论

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