Passing InnerHTML to Another Page

G

Gus

Hey Everyone,

I have a situation in where i have dynamically generated reports that
need to open up in a spreadsheet. Problem is i cant modify the server
side pages all i have are the rendered html....is it possible to grab
the innerHTML table and send it to a server-side page?

Thanks in advance. Gus
 
P

plato

It's kinda dirty but you could engineer something like this to happen
onsubmit, where <input type="hidden" id="someInputBox"> is somewhere in
the form:

var htmlToGrab = document.getElementById( containerElement );
var hiddenInputBox = document.getElementById( someHiddenInputBox );

hiddenInputBox.value = htmlToGrab.innerHTML;

Then, the innerHTML would be available as if it were an original form
element. Is this what you were looking for?

-plato
 
R

RobG

plato said:
It's kinda dirty but you could engineer something like this to happen
onsubmit, where <input type="hidden" id="someInputBox"> is somewhere in
the form:

var htmlToGrab = document.getElementById( containerElement );
var hiddenInputBox = document.getElementById( someHiddenInputBox );

hiddenInputBox.value = htmlToGrab.innerHTML;

Then, the innerHTML would be available as if it were an original form
element.

No, it wont. Different browsers will give different results depending
on whether the user has modified the value of text input elements.
 

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

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top