W3C home > Mailing lists > Public > public-forms@w3.org > May 2007

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

From: Klotz, Leigh <Leigh.Klotz@xerox.com>
Date: Mon, 21 May 2007 12:10:46 -0700
Message-ID: <E254B0A7E0268949ABFE5EA97B7D0CF40325759E@usa7061ms01.na.xerox.net>
To: "Blake Jones" <blake.jones@ViewPlus.com>
Cc: <public-forms@w3.org>
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.
So if an HTML4 form control has an initial value, then it has a current
   <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
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
<html xmlns="http://www.w3.org/1999/xhtml">
    <form action="http://xformstest.org/cgi-bin/echo.sh" method="post">
        <label for="a">a:</label> <input name="a" />
        <input type="submit" />
    <form action="http://xformstest.org/cgi-bin/echo.sh" method="get">
        <label for="b">b:</label> <input name="b" />
        <input type="submit" />


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

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.



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 
	Instead, you get
	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.


	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:
	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. 
	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
Received on Monday, 21 May 2007 19:11:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:48:21 UTC