Javascript "MULTIPLE Selection" Select box validation? -


i have multiple selection select box. need validated using javascript, should prompt select atleast 1 value.

below multiple select box have.

<select name="usrgrp[]" multiple="multiple" size="3"> <option value="11">abc</option> <option value="12">def</option> <option value="13">ghi</option> </select> 

please me write validation javascript select box.

if (referencetoform.elements["usrgrp[]"].selectedindex == -1) {   alert("please select item."); } 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -