accessing javascript-generated table elements after submit

P

pbd22

Hi.

If I have a dynamically generated table using javascript (and the
table changes based on various click events prior to form submit) and
I want to populate one of the table's <td></td> elements from the
server (after the form is submitted), how do I do that? In your
answer, please provide a suggestion as to how this can be done.

Thanks for your time.
 
E

Evertjan.

pbd22 wrote on 18 nov 2009 in comp.lang.javascript:
If I have a dynamically generated table using javascript (and the
table changes based on various click events prior to form submit) and
I want to populate one of the table's <td></td> elements from the
server (after the form is submitted), how do I do that?

You cannot populate a clientside page from the server.
In your answer,
please provide a suggestion as to how this can be done.

Read up in Ajax,
wich does not provide your solution,
but shows how clientside script can obtain serverside information.
 
C

Csaba Gabor

If I have a dynamically generated table using javascript (and the
table changes based on various click events prior to form submit) and
I want to populate one of the table's <td></td> elements [with data
returned] from the server (after the form is submitted),
how do I do that?

Sure you can: with target, IFrame, and onload.

Evertjan notwithstanding, the first part is perfectly
good English, so I can't tell if the first part of the
response from The Netherlands was serious or an attempt
to point out that one might misread the OP's intent.

What strikes me as incongruous, though, is the really odd
construct of the OP's next two sentences (and especially
the first), which do not mesh with the prior ones. It is
frequently a form that occurs in homework problems.
For that reason I have kept my response minimal.

Csaba Gabor from Vienna
 
D

David Goldstein

If I have a dynamically generated table using javascript (and the
table changes based on various click events prior to form submit) and
I want to populate one of the table's <td></td> elements [with data
returned] from the server (after the form is submitted),
how do I do that?

Sure you can: with target, IFrame, and onload.

Evertjan notwithstanding, the first part is perfectly
good English, so I can't tell if the first part of the
response from The Netherlands was serious or an attempt
to point out that one might misread the OP's intent.

What strikes me as incongruous, though, is the really odd
construct of the OP's next two sentences (and especially
the first), which do not mesh with the prior ones. It is
frequently a form that occurs in homework problems.
For that reason I have kept my response minimal.

Csaba Gabor from Vienna
In your answer, please provide a suggestion as to
how this can be done.

Thanks for your time.

Isn't this the point of AJAX? The data returned from the server is an
xmlHTTPResponse and the data is there to do what you want with it. Am i
missing the point in the original question? For example, a call is made to
the server through a PHP script. I can simply build a string of data and
echo it back to the client making the call.

The javascript can them manipulate that data however I deem fit. As an
example, if I try and establish a connection to a database and en error is
returned, I can send a message back to the client and am able to access it
through responseText or responseXML. I can then populate a <div> using
innerHtml, for example.

If what the user is questioning was not possible, how else would I populate
a table of data that I recieve back from the server?

David
 
D

David Goldstein

Evertjan. said:
pbd22 wrote on 18 nov 2009 in comp.lang.javascript:


You cannot populate a clientside page from the server.


Read up in Ajax,
wich does not provide your solution,
but shows how clientside script can obtain serverside information.

Sorry, I am tired and misread your response. :)

David
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top