|
next
|
Subject: Re: Receiving XML through Form POST request Author: (Deleted User) Date: 26 Nov 2001 10:18 AM
|
At 03:23 PM 11/23/2001 -0500, you wrote:
>From: "Atif Sarfraz"
>
>Hi,
>
>I have generated a form output in Internet Explorer, using XML and
>applying XSL transformation on it at browser end. Now I want to receive
>the results back at server end, in the form of XML document. So when a
>user makes any changes in the form and resubmits the form, I want to get
>the results at server in the form of XML document.
>
>Is it possible?
Yes, it's possible, but it's not straightforward. A way you can achieve
this is by adding an hidden entry in the form and trap the pressing of the
"Submit" button
{FORM NAME=postForm METHOD=POST ACTION="update.asp"}
{INPUT TYPE=HIDDEN NAME=XML}
... other user visible entries ...
{INPUT TYPE="BUTTON" VALUE="Edit" ONCLICK="submitInfo()"}
{/FORM}
The submitInfo function can then fill the "XML" variable with the XML
representation of the input fields, like in
{script language="JavaScript"}
function submitInfo()
{
var pf = document.postForm;
pf.XML.value = "{?xml version='1.0'?}{title}"+pf.InputField1+.....;
pf.submit();
}
{/script}
If you want to send just the XML representation (without the other input
fields), you can split the FORM entry into 2 (one holding the HIDDEN entry,
the other holding the user-editable fields plus the submit button)
Hope this helps,
Alberto
|
|
|
|