Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Reading HTML contents from the server

Reply
Thread Tools

Reading HTML contents from the server

 
 
milkyway
Guest
Posts: n/a
 
      12-17-2004
Hello all,

Is this possible
1. Create a table in HTML
2. Through javascript add and delete items to the table
(have already done this)
3. Hit the save button and pass the contents of the table to the
server.

Are there any examples out there where the table contents are being
passed to the server?

How can one do this? I am basically looking to pass such contents to a
bean (i.e. 1 'get' statement would fetch all of the items in the HTML
table).

Kindest Regards.

 
Reply With Quote
 
 
 
 
Dag Sunde
Guest
Posts: n/a
 
      12-17-2004
"milkyway" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Hello all,
>
> Is this possible
> 1. Create a table in HTML
> 2. Through javascript add and delete items to the table
> (have already done this)
> 3. Hit the save button and pass the contents of the table to the
> server.
>
> Are there any examples out there where the table contents are being
> passed to the server?
>
> How can one do this? I am basically looking to pass such contents to a
> bean (i.e. 1 'get' statement would fetch all of the items in the HTML
> table).
>


This is really a JavaScript question...:

Just as you put the values into the table cells with JavaScript,
write a JavaScript function to extract the values from the table
cells and build a (ie. semicolon/Cr separated) string from them.
document.getElementById("cellId_N");

Now put this string into a hidden form-field, and submit the form
.form.doSubmit();

--
Dag.


 
Reply With Quote
 
 
 
 
milkyway
Guest
Posts: n/a
 
      12-18-2004
Thank you for responding

I have created cells with the opposite command in Javascript DOM:

for iteration = 1 to 999
cell.setAttribute('name', 'Cell' + iteration);
end

Now on the server side, I am trying to get the value on the server side
with something like

for i = 1 to 999
value = getvalue of ('cell' + i); <-------
end


The arrow is what I need now. How to get avalue like this out on the
server side.

Any ideas?

Kindest Regards.


Dag Sunde wrote:
> "milkyway" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ups.com...
> > Hello all,
> >
> > Is this possible
> > 1. Create a table in HTML
> > 2. Through javascript add and delete items to the table
> > (have already done this)
> > 3. Hit the save button and pass the contents of the table to the
> > server.
> >
> > Are there any examples out there where the table contents are being
> > passed to the server?
> >
> > How can one do this? I am basically looking to pass such contents

to a
> > bean (i.e. 1 'get' statement would fetch all of the items in the

HTML
> > table).
> >

>
> This is really a JavaScript question...:
>
> Just as you put the values into the table cells with JavaScript,
> write a JavaScript function to extract the values from the table
> cells and build a (ie. semicolon/Cr separated) string from them.
> document.getElementById("cellId_N");
>
> Now put this string into a hidden form-field, and submit the form
> .form.doSubmit();
>
> --
> Dag.


 
Reply With Quote
 
Hal Rosser
Guest
Posts: n/a
 
      12-18-2004

"milkyway" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Thank you for responding
>
> I have created cells with the opposite command in Javascript DOM:
>
> for iteration = 1 to 999
> cell.setAttribute('name', 'Cell' + iteration);
> end
>
> Now on the server side, I am trying to get the value on the server side
> with something like
>
> for i = 1 to 999
> value = getvalue of ('cell' + i); <-------
> end
>
>
> The arrow is what I need now. How to get avalue like this out on the
> server side.
>

Dag gave you the answer.
you can put the data in a form by using hidden form fields
then submit the form
- BTW - JavaScript is not Java


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.818 / Virus Database: 556 - Release Date: 12/17/2004


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding contents on yaml file without overwriting actual contents Kamarulnizam Rahim Ruby 4 01-28-2011 09:10 AM
if innerHTML used twice then it replaces the contents i want it to display all the contents virendra.amritkar@gmail.com Javascript 0 06-29-2007 08:13 AM
Reading Contents of Server Controls In ASP.net Rush ASP .Net 0 08-30-2006 07:31 AM
HTML Contents in GridView Rows Will Not Display as HTML? Joey ASP .Net 0 12-22-2005 03:14 PM
Can I restrict both attribute contents and element contents in schema Don Adams XML 1 03-05-2004 12:48 PM



Advertisments