View Single Post
  #1 (permalink)  
Old August 26th, 2004, 12:54 PM
theguardian@vsnl.net theguardian@vsnl.net is offline
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Accessing of Arrays of jsp in javascript

Hello Sir / Madam,
     How to acess the value of array in javascript function. consider the following example

<script language = javascript>
function check_max()
{
   var i = 0;
   for (i = 0; i< parseInt(document.form[0].hid_cnt.value); i++)
   {
     alert(document.forms[0].cmb_max[i].value);
   }
}
</script>
<body>
<%
// consider rs to be a recordset
    int cnt = 0;
    while (rs.next())
    {
%>
           <select name = cmb_max[<%=cnt%>]>
           <option value = 2>
                    2
           </option>
           </select>
<%
    }
%>
<input type = button value = "Calculate" onclick=check_max()>
</body>
on clicking of calculate the value 2 should be poped up which is not done. so kindly rectify my problem as soon as possible.
kindly mail me on theguardian@vsnl.net



Reply With Quote