Reading HTML contents from the server

Discussion in 'Java' started by milkyway, Dec 17, 2004.

  1. milkyway

    milkyway Guest

    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.
     
    milkyway, Dec 17, 2004
    #1
    1. Advertising

  2. milkyway

    Dag Sunde Guest

    "milkyway" <> wrote in message
    news:...
    > 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.
     
    Dag Sunde, Dec 17, 2004
    #2
    1. Advertising

  3. milkyway

    milkyway Guest

    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" <> wrote in message
    > news:...
    > > 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.
     
    milkyway, Dec 18, 2004
    #3
  4. milkyway

    Hal Rosser Guest

    "milkyway" <> wrote in message
    news:...
    > 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
     
    Hal Rosser, Dec 18, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joey
    Replies:
    0
    Views:
    992
  2. Don Adams
    Replies:
    1
    Views:
    626
    Martin Honnen
    Mar 5, 2004
  3. Rush
    Replies:
    0
    Views:
    306
  4. Kamarulnizam Rahim
    Replies:
    4
    Views:
    250
    Robert Klemme
    Jan 28, 2011
  5. Replies:
    0
    Views:
    220
Loading...

Share This Page