Re: XForms: submission with POST, does it work?

Aaron Reed <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Pascal Sartoretti wrote:
> Nils Dehl wrote:
> 
>> this code snippet work on my test system:
>>
>> $postedXML = new DOMDocument();
>> $loaded = @$postedXML->load('php://input');
>> if ($loaded) {
>>   $postedXML->save('test.xml');
>> }
> 
> 
> Thanks for you help, but my problem is on the client side; my server 
> (ruby's WEBrick) simply doesn't seem to receive anything from the 
> FireFox client when using "post" as method. Could you please show me how 
> you configured the <submission> ?
> 
> Pascal

Hey Pascal,

Here is a testcase that works for me.

<?xml version="1.0" encoding="UTF-8"?>
<!-- basic FO page definition stuff -->
<html xmlns="http://www.w3.org/1999/xhtml" 
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
     <head>
       <title>Submission Testcase</title>
       <style type="text/css">
         @namespace xf url("http://www.w3.org/2002/xforms");
         xf|*:invalid input {
           background-color: red;
         }
         xf|*:disabled input {
           display: none;
         }
       </style>
       <xforms:model>
         <xforms:instance xmlns="">
           <values>
             <value>default</value>
             <name>Click to Submit</name>
           </values>
         </xforms:instance>

         <xforms:submission id="submitInfo"
                            method="post"
                            ref="/values"
 
action="http://www.xformstest.org/cgi-bin/echo.sh" >
           <xforms:message level="modal" 
ev:event="xforms-submit-error">We got a submit error</xforms:message>
         </xforms:submission>
       </xforms:model>
     </head>
     <body>
       <h2>This testcase exercises submission
       </h2>

       <p>
         <xforms:input ref="value">
           <xforms:label>Please enter a value to submit: </xforms:label>
         </xforms:input>
       </p>
       <p>
         <xforms:submit submission="submitInfo" ref="name" >
           <xforms:label ref="."/>
         </xforms:submit>
       </p>
     </body>
</html>

--Aaron
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.