Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
| Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 26th, 2004, 12:55 PM
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


  #2 (permalink)  
Old August 26th, 2004, 11:16 PM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , India.
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default


Get the ResultSet in the form of ArrayList/Iterator and then you can use the setXXXX & getXXXX methods.....
You can also refer some of the code sample about the
http://www.javaranch.com/newsletter/200403/RSS.html




http://www.javaranch.com/newsletter/200403/RSS.html



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help: Arrays using JavaScript,/JSP Iterator in IE celticbhoy Javascript How-To 3 December 11th, 2007 10:55 AM
Help: Arrays using JavaScript,/XML in IE celticbhoy Ajax 0 December 10th, 2007 01:15 PM
error accessing database connection using jsp muthumari_p2003@yahoo.com Pro JSP 0 May 8th, 2006 05:54 AM
Comparing arrays in javascript JohnD Javascript How-To 0 August 29th, 2004 02:32 PM
Accessing of Arrays of jsp in javascript theguardian@vsnl.net JSP Basics 0 August 26th, 2004 12:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.