HighDots Forums  

How do I get HTML sent to server?

Javascript JavaScript language (comp.lang.javascript)


Discuss How do I get HTML sent to server? in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
SAM
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-16-2008 , 08:49 PM






MC a écrit :
Quote:
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 ?

Quote:
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

Quote:
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)

--
sm


Reply With Quote
  #22  
Old   
MC
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-16-2008 , 09:12 PM






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



Reply With Quote
  #23  
Old   
Evertjan.
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-17-2008 , 04:57 AM



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

Quote:
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-o...nerHTML_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?".

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Reply With Quote
  #24  
Old   
beegee
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-17-2008 , 08:32 AM



On Jun 17, 5:57*am, "Evertjan." <exjxw.hannivo... (AT) interxnl (DOT) net> wrote:
Quote:
SAM wrote on 17 jun 2008 in comp.lang.javascript:



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-o...nerHTML_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?".


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



Reply With Quote
  #25  
Old   
Captain Paralytic
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-17-2008 , 08:39 AM



On 16 Jun, 18:03, "david.karr" <davidmichaelk... (AT) gmail (DOT) com> wrote:
Quote:
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)


Reply With Quote
  #26  
Old   
MC
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-17-2008 , 09:37 AM



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.innerHTM L);
window.print();
}

MC
PS using screenshots was never really considered.



Reply With Quote
  #27  
Old   
Lasse Reichstein Nielsen
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-17-2008 , 10:20 AM



"MC" <mica[removethis]@aisus.com> writes:

Quote:
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
--
Lasse Reichstein Nielsen - lrn (AT) hotpop (DOT) com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'


Reply With Quote
  #28  
Old   
SAM
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-17-2008 , 11:27 AM



MC a écrit :
Quote:
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.

Quote:
It may
not be perfect but its good enough. Consistent, is the legal requirement,
not perfection.

function printForm() {
sendArchivalCopy(document.documentElement.innerHTM L);
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)

Quote:
window.print();
That doesn't work with my IE Mac

Quote:
}

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

--
sm




Reply With Quote
  #29  
Old   
MC
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-17-2008 , 11:46 AM



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.



Reply With Quote
  #30  
Old   
SAM
 
Posts: n/a

Default Re: How do I get HTML sent to server? - 06-17-2008 , 12:48 PM



MC a écrit :
Quote:
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)

Quote:
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

--
sm




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.