RE: List discussion issue: Pruning empty nodes on url-encoded submission

Blake,
Interesting point.  The referenced section 
  The control's "current value" is first set to the initial value.
Thereafter, the control's current value may be modified through user
interaction and scripts.
<http://www.w3.org/TR/html401/interact/scripts.html> 
 
So if an HTML4 form control has an initial value, then it has a current
value.
 
So 
   <input name="foo" value="">
seems like it would get submitted in HTML4.
 
Or am I misreading the definition of "current value".
 
In XForms, I'd translate the value attribute to the initial value in the
instance, so if the value attribute is present but equal to "" in HTM4,
then it's like having the node present but empty-valued in the instance.
So, in XForms, if the node is present but of string-length 0, we'lll
submit it as an empty string.  If the node is absent, we won't submit
it, and I'd argue this case is the analog of the HTML4 case with no
value.
 
Here's a test program that cant tell whether a browser submits or not.
My tests show that the presence of an initial value="" isn't required,
but I'm willing to believe that's at variance with the HTML4
recommendation.  
 
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>foo</title>
  </head>
  <body>
    <form action="http://xformstest.org/cgi-bin/echo.sh" method="post">
      <fieldset>
        <legend>Post</legend>
        <label for="a">a:</label> <input name="a" />
        <input type="submit" />
      </fieldset>
    </form>
 
    <form action="http://xformstest.org/cgi-bin/echo.sh" method="get">
      <fieldset>
        <legend>Get</legend>
        <label for="b">b:</label> <input name="b" />
        <input type="submit" />
      </fieldset>
    </form>
  </body>
</html>

 
________________________________

From: Blake Jones [mailto:blake.jones@ViewPlus.com] 
Sent: Monday, May 21, 2007 11:54 AM
To: Klotz, Leigh
Cc: public-forms@w3.org
Subject: Re: List discussion issue: Pruning empty nodes on url-encoded
submission


In researching this, I discovered that the HTML4 spec does not require
an empty submission:



>From HTML 4.01 spec. 24 DEC 1999
17.13.2 Successful Controls
"If a control doesn't have a current value
<http://www.w3.org/TR/html401/interact/forms.html#current-value>  when
the form is submitted, user agents are not required to treat it as a
successful control."


Only "successful controls" are submitted.


I think most (all?) browsers do submit empty control values, so I
propose that we should specify that (X)forms submissions _should_ submit
empty values in an attempt at paralleling the de facto HTML practice.


Thoughts?


Blake




Klotz, Leigh wrote: 

	I apologize for the distraction during the meeting and for
sending both issues in the same message.
	 
	- If you submit with method="get", nodes whose string content is
empty get elided, so there's no way to do a GET of 
	 http://example.com/query?a=1;b=;c=3
	Instead, you get
	 http://example.com/query?a=1;c=3 
	 
	I believe the correct behavior is that the empty item should be
serialized as "name=" but no value.
	I believe that only missing or non-relevant b is what should
cause the elision.
	 
	- In HTML4, empty string content values are still submitted.
	 
	Attached are examples of a single-parameter query/echo form
example in XHTML+XForms and XHTML1.
	 
	Leigh.

________________________________

	From: public-forms-request@w3.org
[mailto:public-forms-request@w3.org] On Behalf Of John Boyer
	Sent: Wednesday, May 02, 2007 1:13 PM
	To: public-forms@w3.org
	Subject: List discussion issue: Pruning empty nodes on
url-encoded submission
	
	

	Turns out the link in the agenda was correct:
http://lists.w3.org/Archives/Public/www-forms/2007Feb/0077.html 
	
	It is the submit-on-enter example from Leigh, which includes
information from Aaron Reed. 
	
	The email points out two problems, the submit-on-enter problem
AND the problem that empty nodes are pruned on URL encoded submissions,
instead of submitting them as empty values. 
	
	Let's get some discussion going on the list here about what the
correct behavior should be. 
	
	Thanks, 
	John M. Boyer, Ph.D.
	STSM: Lotus Forms Architect and Researcher
	Chair, W3C Forms Working Group
	Workplace, Portal and Collaboration Software
	IBM Victoria Software Lab
	E-Mail: boyerj@ca.ibm.com  
	
	Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer
	
	


-- 
Blake Jones
Software Engineer
ViewPlus Technologies
blake.jones@viewplus.com

Received on Monday, 21 May 2007 19:11:02 UTC