How do I get HTML sent to server?

D

dhtml

[snip]


The non-standard innerHTML property only reads the original value
of input controls (i.e., "inputControl.originalValue", not the currently
entered value, "inputControl.value"). I.e., it misses the user entered
values.

This means that the HTML you generate is not what is currently being
shown, but *your* conversion of the DOM objects into a text
representation. If you are doing that anyway, why not just send
the values and build the structure on the server side.

InnerHTML may "reflect" current values.

To see if value of document.title is reflected in your browser, try
the following, in order:

javascript:alert(document.title=1)
javascript:alert(document.getElementsByTagName("title")[0].innerHTML)

Try a similar experiment with form elements, too.

javascript:alert(document.forms[0].elements[0].value="jp")
javascript:alert(document.forms[0].elements[0].parentNode.innerHTML)

Would show the innerHTML reflecting in Firefox and IE (but not
Safari).

Garrett
 
S

SAM

MC a écrit :
Just sending the data back will not work, as the client view may have html
content from other sources in its view.

how that could be possible ?
Didn't you send the original html code ?
I understand that a screenshot would work...any ideas on sending one back to
the server based on a .js event? I would really prefer to have a data image
as I can encrypt that and still retrieve the data from it.

getting the image to data can be made on server, that is not the problem

it is :
- to realize a snapshot at the user
- to send back this snapshot
two operations impossible in JS
Is there any way to traverse and build the HTML and get the user entered
data? This is the real question no one seems to be able to answer.

<http://stephane.moriaux.pagesperso-orange.fr/truc/innerHTML_danger>

As told you'll have to get all parts of the DOM while translating them
in html without forgiving the content of forms's fields and other
attributes of the tags and to put all that code in an hidden field sent
with the form.
But this method (if it works) will not allow you to assure the user did
really saw what you or I will see with this code.

The only possibly available method is to send back a PDF view of same
html served with the form completed with what was sent back by the form,
for agreement by user.

And what about certificates ?

What about forms in PDF ?
(I don't know how to send back a filed pdf form)
 
M

MC

Sam,

The user will always initiate the archival action. They will complete the
form, then press print. At that time, the print method will be called and
the data sent via ajax back to the server to make a copy.

The image does not have to be exact to be a legal copy only the best
approximation available.

MC
 
E

Evertjan.

SAM wrote on 17 jun 2008 in comp.lang.javascript:
MC a écrit :

how that could be possible ?
Didn't you send the original html code ?


getting the image to data can be made on server, that is not the
problem

it is :
- to realize a snapshot at the user
- to send back this snapshot
two operations impossible in JS


<http://stephane.moriaux.pagesperso-orange.fr/truc/innerHTML_danger>

As told you'll have to get all parts of the DOM while translating them
in html without forgiving the content of forms's fields and other
attributes of the tags and to put all that code in an hidden field
sent with the form.
But this method (if it works) will not allow you to assure the user
did really saw what you or I will see with this code.

The only possibly available method is to send back a PDF view of same
html served with the form completed with what was sent back by the
form, for agreement by user.

And what about certificates ?

What about forms in PDF ?
(I don't know how to send back a filed pdf form)

SAM your advice is sound, however ...

Perhaps the OP could ask the user to buy a digital camera and take a shot
of the monitor screen, and then send that image over to the server?

The subject is: "How do I get HTML sent to server?".
 
B

beegee

SAM wrote on 17 jun 2008 in comp.lang.javascript:










SAM your advice is sound, however ...

Perhaps the OP could ask the user to buy a digital camera and take a shot
of the monitor screen, and then send that image over to the server?

The subject is: "How do I get HTML sent to server?".


Precisely. If the OP wants to see the closest anyone has come to
rendering dynamic HTML, look at Full Source (IE only)
http://www.thundermain.com/FullSource.html. Still, if you want the
web page generated by Full Source to look as it does it IE, you have
to blast the styles onto the page manually.

I can't believe I read this whole thread only to get to screenshots.
Maybe the OP could swing a deal with a disposable digital camera
manufacturer. The thread reminds me to be grateful that I work for a
company who's business model is based in reality.

Bob
 
C

Captain Paralytic

You might consider encapsulating the "legal" information into PDF and
archiving that.  That would be a more reliable rendering of what "they
saw", because PDF rendering is less variable between browsers.
I think more to the point is that PDFs are not rendered by browsers,
they are viewed through PDF viewers (e.g. Adobe Acrobat Reader)
 
M

MC

If your looking for the answer,
I was able to duplicate the page the user views. I sent the innerHTML back
to the server and it duplicated several test pages PERFECTLY with form data.

This is great as we can snapshot what the user sees when they print. It may
not be perfect but its good enough. Consistent, is the legal requirement,
not perfection.

function printForm() {
sendArchivalCopy(document.documentElement.innerHTML);
window.print();
}

MC
PS using screenshots was never really considered.
 
L

Lasse Reichstein Nielsen

MC said:
If your looking for the answer,
I was able to duplicate the page the user views. I sent the innerHTML back
to the server and it duplicated several test pages PERFECTLY with form data.

The problem is that innerHTML is non-standard and doesn't work the same in
all browsers. In mine (Opera) it doesn't show the current value, but the
original value, of form controls.

/L
 
S

SAM

MC a écrit :
If your looking for the answer,
I was able to duplicate the page the user views. I sent the innerHTML back
to the server and it duplicated several test pages PERFECTLY with form data.

This is great as we can snapshot what the user sees when they print.

When I print
I see nothing more at screen that is already displayed on the screen,
except the printer's dialog box.
It may
not be perfect but its good enough. Consistent, is the legal requirement,
not perfection.

function printForm() {
sendArchivalCopy(document.documentElement.innerHTML);

it is what we say since ... houlala 30 posts ?

innerHTML doesn't work with tags input (and some others attributes)

Did you go to see my little demo about that ?

Once again, you can reasonably only get what is usual :
names of tags input and their values
sent by the form (or by JS function XMLHttpRequest if supported)
window.print();

That doesn't work with my IE Mac
}

MC
PS using screenshots was never really considered.

:)

Dommage, j'aimais bien l'idée.

Usually,
- the filed form is send to the server (submitted by user),
- the server send back an unmodifiable copy
(without fields, only the values)
- the user push a button to agree (a new submit)
- the server save the same copy
and send back a message : all was correct (or not ...)
et merci et à bientôt
 
M

MC

Sam,

We support IE and Firefox only. Since this is a business environment and not
consumer, we can dictate that. We also recommend IE7 as preferred since we
have several USB tools that have plugins to IE. We do try to validate W3C as
much as possible.

So Opera, Safari, etc are just not issues...out of over 2000 business users
we have there is not one Mac. The fact that the code is non-standard is a
non-issue.

MC
PS for the code to work, you need to finish out the sendArchive function
with ajax.
 
S

SAM

MC a écrit :
Sam,

We support IE and Firefox only. Since this is a business environment and not
consumer, we can dictate that. We also recommend IE7 as preferred since we
have several USB tools that have plugins to IE. We do try to validate W3C as
much as possible.

try my demo with Firefox (Fx does as Opera or Safari)
and try it too with IE (any of them > 5)
MC
PS for the code to work, you need to finish out the sendArchive function
with ajax.

I will finish anything.

Functions type Ajax are on the Net :
<http://developer.mozilla.org/en/docs/AJAX:Getting_Started>
<http://jibbering.com/2002/4/httprequest.html>
<http://www.ajaxtoolbox.com/>
<http://ajaxpatterns.org/Ajax_Examples>

etc
 
E

Evertjan.

MC wrote on 17 jun 2008 in comp.lang.javascript:

[please always quote on usenet, this is not email, MC]
We support IE and Firefox only. Since this is a business environment
and not consumer, we can dictate that. We also recommend IE7 as
preferred since we have several USB tools that have plugins to IE. We
do try to validate W3C as much as possible.

So Opera, Safari, etc are just not issues...out of over 2000 business
users we have there is not one Mac. The fact that the code is
non-standard is a non-issue.

And the judge will just believe your dictate?

When you tell him you are showing a serverside reconstruction of what you
believe to have been on the users monitor, because you dictated something
to the defending party, and that that amounts to legal proof, he will have
a fit laughing.

Especially if the defence gets hold of this NG thread.
 
M

MC

I thought this was a thread about getting client html sent back to the
server. I don't give a rats fat behind about your legal opinion as it
doesn't hold water here. Fact is, 'reasonable' and 'consistent' are key
ideals of the law here....not perfection. Guess we are just not as good as
you.

MC
 
E

Evertjan.

MC wrote on 17 jun 2008 in comp.lang.javascript:
I thought this was a thread about getting client html sent back to the
server. I don't give a rats fat behind about your legal opinion as it
doesn't hold water here. Fact is, 'reasonable' and 'consistent' are
key ideals of the law here....not perfection. Guess we are just not as
good as you.

To whom and to what are you responding?

You seem to have a lot to learn about usenet posting.

You seem angry, why? And at whom?
 
M

MC

Evertjan. said:
MC wrote on 17 jun 2008 in comp.lang.javascript:


To whom and to what are you responding?

You seem to have a lot to learn about usenet posting.

You seem angry, why? And at whom?

At whom???
I'm not angry. Frustrated maybe. Instead of helping, you are concerned about
criticizing my business. I didn't ask for business help, I asked for a how
to with javascript. Instead of help, I got a ranting about legal issues,
browsers, why something shouldn't be done, and rudeness. It seems that you
think its ok to usenet post garbage like this. I hope to not learn any of
your behaviors about usenet posting. It seems that you are trolling more
than helping and having fun doing it. I don't know why, as I know from other
posts that you are knowledgeable about javascript.

MC
 
E

Evertjan.

MC wrote on 18 jun 2008 in comp.lang.javascript:

[please do not quote signatures on usenet]
At whom???
I'm not angry. Frustrated maybe. Instead of helping, you are concerned
about criticizing my business.

I am not critisizing your business, I don't even know you have one.

As for helping, I think I am helping, but this is not a helpdesk, you are
not entitled to help and only that., this is usenet.
I didn't ask for business help, I asked for a how to with javascript.

So? You got your answer: impossible.

Recapitulating:

Clientside browser Javascript cannot get the full html of a page, and
even if it would, it would be reconstructed from the DOM, and not show
the actual image representation, as that is also dependent on window
size, Browser settings, type end version, screen size, operating system,
and more.
Instead of help, I got a ranting about
legal issues, browsers, why something shouldn't be done, and rudeness.

Haha, you are angry. Be angry at yourself. You explained you needed it
for legal purposes.
It seems that you think its ok to usenet post garbage like this.

That it is garbage is not what I hink, and it is not for you to decide
what is ok on usenet, that's what Netiquette is for.

Do you really think usenet is a helpdesk?
I hope to not learn any of your behaviors about usenet posting.
It seems that you are trolling more than helping
and having fun doing it.

So what if so? you are the asking party and you do not want to hear an
answer that would really help you: that your quest is useless, because
sending the html back by javascript is impossible, that reconstructing
the html [that you cannot get back] to an image is not your requested
legal proof.
I don't know why, as I know from other posts that you are
knowledgeable about javascript.

So do not despair, lay down that frustration, just take up the many
advises I and others have posted here in this thread to make an
alternative approach.

.... and never, never think anymore this is a paid [or even unpaid]
helpdesk, were posting a Q gives you privileges on specifying what
answers you want or do not want. After all, this is usenet.

.... and yes, I have fun, fun in helping, but not to the expense of
leaving you the false idea that it is possible to do what you ask, when
it is not.

.... and your ideas about usenet are funny indeed.
 

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,141
Messages
2,570,817
Members
47,366
Latest member
IanCulpepp

Latest Threads

Top