Connecting Tech Pros Worldwide Forums | Help | Site Map

Passing InnerHTML to Another Page

Gus
Guest
 
Posts: n/a
#1: Aug 16 '06
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


plato
Guest
 
Posts: n/a
#2: Aug 17 '06

re: Passing InnerHTML to Another Page


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

Gus
Guest
 
Posts: n/a
#3: Aug 17 '06

re: Passing InnerHTML to Another Page


Just what i wanted, thanks a mil, plato.



plato wrote:
Quote:
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
RobG
Guest
 
Posts: n/a
#4: Aug 17 '06

re: Passing InnerHTML to Another Page



plato wrote:
Quote:
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.


--
Rob

Closed Thread