Cycling through a Multiple-Selection List : List : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » List »

 

Cycling through a Multiple-Selection List



<HTML>
<HEAD>
<TITLE>Accessories List</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function seeList(form) {
    var result = ""
    for (var i = 0; i < form.accList.length; i++) {
        if (form.accList.options[i].selected) {
            result += "n  " form.accList.options[i].text;
        }
    }
    alert("You have selected:" + result);
}
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<P>Control/Command-click on all accessories you use:
<SELECT NAME="accList" SIZE=MULTIPLE>
    <OPTION SELECTED>A
    <OPTION>B
    <OPTION>C
    <OPTION>D
    <OPTION>E
    <OPTION>F
    <OPTION>G
</SELECT> </P>
<P><INPUT TYPE="button" VALUE="View Summary..."
 onClick="seeList(this.form)"></P>
</FORM>
</BODY>
</HTML>


           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Form Control
» List