File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Array storing and retrieval Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Array storing and retrieval" Watch "Array storing and retrieval" New topic
Author

Array storing and retrieval

Wilfred D'Souza
Greenhorn

Joined: Mar 09, 2004
Posts: 8
Hi !
I am using JSP (with javascript and HTML).
I need to do couple of things :
a. To store data retrieved in an array. (JSP)
b. To store the array in a INPUT TEXT tag (HTML)
c. THEN finally to retrieve this array in Javascript to validate in order to populate data in another INPUT TEXT tag. (Javascript)
Could anyone help me with this ? I am stuck at point 3.
Any help is highly appreciated.
Thanx in advance


Best regards<br />Wilfred D'Souza
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
Okay, I am lost what you are actually doing...
You have a jsp page where it writes the values on an array into a text box? You then want to validate this information and enter it into another textbox?
What is the validation supposed to do? When is this validation supposed to happen?
Eric
Wilfred D'Souza
Greenhorn

Joined: Mar 09, 2004
Posts: 8
Hi Eric,
I have a JSP which first gets data from a database stores it in an arry. This I want to store in a field (which should be in a HTML field) which I am not sure what type. This field should be hidden. Then I want to validate another field (again in HTML on the same JSP) onchange of which should validate the hidden field (which has the array).
First of all is this possible. If yes then how.
Thank you for replying so soon.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
<input type="hidden" name="YourData" value="<% JSP CODE%>">
I have no idea what youa re validating, numbers, text, etc.....
Eric
Wilfred D'Souza
Greenhorn

Joined: Mar 09, 2004
Posts: 8
Hi Eric,
I want to retrieve the charges description from the database file.
Please check if the following is possible :
<%
define array Charges;
Create connection to database;
Create result set;
int i =0;
while rs.next()
{
charges[i]= fetch value from database and put it in the array (text format);
i++;
}
Shutdown connection;
%>
<script>
function getDesc(iwantthis)
{
i want to take the input of the field CHG1 and HTEXT and get the charge description here.
}
</script>
<tr>
<td><input type="HIDDEN" size=999 value="<%= Charges%>" name="HTEXT"></td>
<td><input type="HIDDEN" size=999 value="<%= i%>" name="HSIZE"></td>
</tr>
<tr>
<td>Service Charge I</td>
<td><input type="TEXT" size=10 maxlength=10 value="" name="CHG1" onchange="getDesc(this.value)"></td>
<td><input type="TEXT" size=30 maxlength=30 value="" name="DCHG1" readonly></td>
</tr>
I want this to happen before I submit it.
Could u please take a look at this.
Thanx !
[ March 09, 2004: Message edited by: Wilfred D'Souza ]
 
 
subject: Array storing and retrieval
 
Threads others viewed
Upload Image to database through Servlet
Getting information from a Image file stored on client side
how to pass an array to servlet
Writing Image Bytes on Response Stream
How to populate a value in text box
developer file tools