Javascript Form How to - Determine the Size of the Select dropdown








Question

We would like to know how to determine the Size of the Select dropdown.

Answer


<HTML>
<HEAD>
<SCRIPT LANGUAGE = "JavaScript">
     function moveon() {<!--from  w w w  .  j  a  v  a 2s . com-->
        var urlAddress = "";
        urlAddress = document.forms[0].Edit1.value;
        parent.frames[1].location = urlAddress;
        document.forms[0].Edit2.value = parent.frames[1].history.length;
      }
  
</SCRIPT>
</HEAD>
  
<BODY>
<FORM>
<INPUT type="text" name="Edit1">
<INPUT type="button" value="move" onClick="moveon()">
<INPUT type="text" name="Edit2">
</FORM>
</BODY>
</HTML>

The code above is rendered as follows: