Latest news
Home » Tag Archives: selected value of select box

Tag Archives: selected value of select box

Get selected value of dropdownlist or select box using JavaScript

For get Selected  option of select box use the “ e.options[e.selectedIndex].value”  in javascript.   Example <select name=”jobrole” id=”jobrole” class=”text2″ style=””> <option value=””>Job Role</option> <option value=”1″ >Technical</option> </select> <script> var e = document.getElementById(‘jobrole’); var jobroleId = e.options[e.selectedIndex].value; if(!jobroleId || jobroleId == ‘0’) { alert(‘Select one job role’); }else { document.frmabtdubai.jobroleflag.value = jobroleId; document.frmabtdubai.submit(); } </script>

Read More »