Re: [whatwg] WF2: Non-validating submit buttons
On Wed, 24 Jan 2007, Martin Atkins wrote: It would be useful to be able to mark certain submit buttons as non-validating. I've added a novalidate= attribute for this case. Thanks for the discussion of use cases and examples of actual sites, which were useful in determining whether this was worth adding, in particular: On Wed, 4 Apr 2007, Martin Atkins wrote: * Allowing the user to submit an unfinished form to the server to be saved for later completion. * A preview button that allows the user to see the results of what has been completed so far without completing the entire form. * Buttons that trigger round-trips to the server to alter the form in some way. On Wed, 4 Apr 2007, Christian Schmidt wrote: There appears to be at least some demand for such a feature, and so far there has been no negative responses. What is the next step? The next step is that I eventually (about 670 days later in this instance) get around to reading the feedback and processing it into the spec. :-) -- Ian Hickson U+1047E)\._.,--,'``.fL http://ln.hixie.ch/ U+263A/, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
Re: [whatwg] WF2: Non-validating submit buttons
Anne van Kesteren wrote: On Wed, 04 Apr 2007 Christian Schmidt wrote: There appears to be at least some demand for such a feature, and so far there has been no negative responses. What is the next step? Providing some compelling usecases. This has been provided a while back. Should I interpret the lack of response as lack of interest in a feature like this? Christian
Re: [whatwg] WF2: Non-validating submit buttons
On Wed, 15 Aug 2007, Christian Schmidt wrote: This has been provided a while back. Should I interpret the lack of response as lack of interest in a feature like this? No; your feedback has been noted and I'll be getting to it in due course (though new features to Web Forms are pretty much at the bottom of the priority list right now, I must be honest). -- Ian Hickson U+1047E)\._.,--,'``.fL http://ln.hixie.ch/ U+263A/, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
Re: [whatwg] WF2: Non-validating submit buttons
2007/4/4, Martin Atkins: * For cancel buttons where the server-side app just throws the submitted form data away, it's pointless to validate it client-side. Attach the cancel button to a distinct 'form' (eventually having the same 'action' and 'method'). * Allowing the user to submit an unfinished form to the server to be saved for later completion. * A preview button that allows the user to see the results of what has been completed so far without completing the entire form. * Buttons that trigger round-trips to the server to alter the form in some way. Those are really good use cases (imo). All three might a priori be achieved using a second 'form' with some javascript to turn every non-validating control to a valid state, and attaching every control to both forms, but that's really tricky, compared to a 'causesvalidation' attribute (I chose 'causesvalidation' because that's the name of the property used in ASP.NET to achieve the same behavior). I'd personally allow such an attribute on both submit buttons and forms (because controls can be attached to multiple forms, it makes sense that validation is triggered depending on the submitting form, not only on which button has been clicked, which might not always be the case: form submitted by javascript). My 2 c€nts -- Thomas Broyer
Re: [whatwg] WF2: Non-validating submit buttons
Martin Atkins skrev: It would be useful to be able to mark certain submit buttons as non-validating. There appears to be at least some demand for such a feature, and so far there has been no negative responses. What is the next step? Christian
Re: [whatwg] WF2: Non-validating submit buttons
On Wed, 04 Apr 2007 14:05:44 +0200, Christian Schmidt [EMAIL PROTECTED] wrote: It would be useful to be able to mark certain submit buttons as non-validating. There appears to be at least some demand for such a feature, and so far there has been no negative responses. What is the next step? Providing some compelling usecases. -- Anne van Kesteren http://annevankesteren.nl/ http://www.opera.com/
Re: [whatwg] WF2: Non-validating submit buttons
Anne van Kesteren wrote: On Wed, 04 Apr 2007 14:05:44 +0200, Christian Schmidt [EMAIL PROTECTED] wrote: It would be useful to be able to mark certain submit buttons as non-validating. There appears to be at least some demand for such a feature, and so far there has been no negative responses. What is the next step? Providing some compelling usecases. I thought we'd already done that. Here's a quick summary of the use-cases presented so far, though of course whether or not they are compelling is up to the reader to decide: * For cancel buttons where the server-side app just throws the submitted form data away, it's pointless to validate it client-side. * Allowing the user to submit an unfinished form to the server to be saved for later completion. * A preview button that allows the user to see the results of what has been completed so far without completing the entire form. * Buttons that trigger round-trips to the server to alter the form in some way. Of these, the first and last are the ones that I find most compelling as they are two things that are done in the wild on the web today that are broken — or at least made a lot more tricky — by the use of Web Forms client-side declarative validation.
Re: [whatwg] WF2: Non-validating submit buttons
On Wed, 21 Mar 2007 17:23:21 +0100, Christian Schmidt [EMAIL PROTECTED] wrote: It would be useful to be able to mark certain submit buttons as non-validating. input type=submit validate=no / How would this be achieved using script? One way is to use a button with the following onclick handler: One of the most appealing advantages of WF2 over HTML4 forms is the ability to express validation requirements declaratively without resort to scripting. If bypassing validation requires scripting, it defeats the advantage. An author could as easily write the validation code in JS rather than expressing validation constraints using WF2 but writing a script to get around validation. -- Alexey Feldgendler [EMAIL PROTECTED] [ICQ: 115226275] http://feldgendler.livejournal.com
Re: [whatwg] WF2: Non-validating submit buttons
Martin Atkins skrev: It would be useful to be able to mark certain submit buttons as non-validating. [...] input type=submit validate=no / I'm not fussed about the exact name/usage of the attribute, but it seems like a common enough case to warrant a declarative solution rather than a script one. How would this be achieved using script? One way is to use a button with the following onclick handler: for (var i = 0; i form.elements.length; i++) { var element = form.elements[i]; if (!element.validity.valid) { element.type = 'text'; element.required = false; element.maxLength = -1; element.setCustomValidity(null); } } form.submit(); Is there a more elegant solution? Christian
Re: [whatwg] WF2: Non-validating submit buttons
2007/3/21, Christian Schmidt: Martin Atkins skrev: It would be useful to be able to mark certain submit buttons as non-validating. [...] input type=submit validate=no / I'm not fussed about the exact name/usage of the attribute, but it seems like a common enough case to warrant a declarative solution rather than a script one. How would this be achieved using script? One way is to use a button with the following onclick handler: for (var i = 0; i form.elements.length; i++) { var element = form.elements[i]; if (!element.validity.valid) { element.type = 'text'; element.required = false; element.maxLength = -1; element.setCustomValidity(null); } } form.submit(); Is there a more elegant solution? Attach a handler for the 'invalid' event on the form to cancel them all and call setCustomValidity(null) on the event.target? (eventually using a second form, specific to the non-validating submit buttons so that you don't have to attach/detach the handler depending on the clicked button; or maybe you could just, in the 'click' event of the submit button, attach the 'invalid' event handler, call form.submit() and then detach the handler?) form action=... id=validating/form form action=... id=non-validating/form ... input type=submit form=non-validating ... script type=text/javascript document.getElementById(non-validating).addEventListener('invalid', function(e) { e.preventDefault(); e.stopPropagation(); e.target.setCustomValidity(''); }, false); /script — or — form action=... ... input type=submit id=non-validating ... script type=text/javascript function cancel_invalid(e) { e.preventDefault(); e.stopPropagation(); e.target.setCustomValidity(''); } document.getElementById(non-validating).addEventListener('click', function(e) { e.form.addEventListener('invalid', cancel_invalid, false); e.form.submit(); e.form.removeEventListener('invalid', cancel_invalid, false); e.preventDefault(); }, false); /script Just ideas, I don't know if this would work at all... -- Thomas Broyer
Re: [whatwg] WF2: Non-validating submit buttons
Hi, From: Kornel Lesinski [EMAIL PROTECTED] Saving incomplete forms is a recommendation in cite isbn=0-7357-1410-X ;) Devensive Design for the Web/cite which provides www.bankone.com as an example site that saves incomplete applicatios (I don't know however if that's via save button or just up to the last completed step). Ok. IMHO non-validating button makes sense for saving drafts of various kinds (webmail, blog post, wiki page). Another use-case is a preview button. Example: comment submission on a blog. You may require users to fill-in their name and e-mail address, but these fields aren't neccessary to display a preview of text formatting. Although if a preview is forced then the fields are in fact not required, but I know that some blogs have both Post and Preview available but I don't know of any that differentiate between fields being required or not required (client-side) for submitting the form using the different submit buttons. I agree though that it would be useful. Regards, Simon Pieters _ Tjäna pengar - sälj på auktion http://tradera.msn.se/
[whatwg] WF2: Non-validating submit buttons
It would be useful to be able to mark certain submit buttons as non-validating. Use case: lots of the forms generated by one of my web-apps have a Cancel button which simply causes the server to redirect the user back to wherever they came from. When I use the WF2 extensions to mark required fields, formats, etc the Cancel button won't submit until the form is completed correctly. This doesn't make much sense from a UI perspective. I propose a flag on the submit button elements (both INPUT and BUTTON TYPE=SUBMIT) which causes the browser not to run the usual validation procedure before submitting when that button is pressed. For example: input type=submit validate=no / I'm not fussed about the exact name/usage of the attribute, but it seems like a common enough case to warrant a declarative solution rather than a script one.
Re: [whatwg] WF2: Non-validating submit buttons
On Wed, 24 Jan 2007 19:03:58 +0100, Martin Atkins [EMAIL PROTECTED] wrote: It would be useful to be able to mark certain submit buttons as non-validating. Use case: lots of the forms generated by one of my web-apps have a Cancel button which simply causes the server to redirect the user back to wherever they came from. When I use the WF2 extensions to mark required fields, formats, etc the Cancel button won't submit until the form is completed correctly. This doesn't make much sense from a UI perspective. I second that. Antoher use case is saving an unfinished form on the server so that the user can continue filling it later. -- Alexey Feldgendler [EMAIL PROTECTED] [ICQ: 115226275] http://feldgendler.livejournal.com
Re: [whatwg] WF2: Non-validating submit buttons
2007/1/24, Martin Atkins: It would be useful to be able to mark certain submit buttons as non-validating. Use case: lots of the forms generated by one of my web-apps have a Cancel button which simply causes the server to redirect the user back to wherever they came from. When I use the WF2 extensions to mark required fields, formats, etc the Cancel button won't submit until the form is completed correctly. This doesn't make much sense from a UI perspective. Cannot you accomplish that by using two forms? form id=cancel action=/cgi-bin/script method=post/form form action=/cgi-bin/script method=post pName : input name=name required/p pinput type=submit name=ok value=Save input type=submit name=cancel value=Cancel form=cancel/p /form -- Thomas Broyer
Re: [whatwg] WF2: Non-validating submit buttons
On Wed, 24 Jan 2007 20:20:50 +0100, Thomas Broyer [EMAIL PROTECTED] wrote: It would be useful to be able to mark certain submit buttons as non-validating. Use case: lots of the forms generated by one of my web-apps have a Cancel button which simply causes the server to redirect the user back to wherever they came from. When I use the WF2 extensions to mark required fields, formats, etc the Cancel button won't submit until the form is completed correctly. This doesn't make much sense from a UI perspective. Cannot you accomplish that by using two forms? Actually, the Cancel button could easily be just a link, not a submit control. However, this doesn't solve the use case of saving an unfinished form server-side. -- Alexey Feldgendler [EMAIL PROTECTED] [ICQ: 115226275] http://feldgendler.livejournal.com
Re: [whatwg] WF2: Non-validating submit buttons
Martin Atkins skrev: It would be useful to be able to mark certain submit buttons as non-validating. Another use case: The WF2 repetition model allows insertion of e.g. extra rows in a table, but all inserted rows etc. are based on the same template. If the new row can be based on different templates, a server round-trip is often preferred (one can probably achieve the intended effect using Ajax, but sometimes a more low-tech solution is preferable). One example of this is this a select control where the user can choose an element to insert and a submit button that inserts the selected element using a post-back but without validating fields on the page that has not been filled out yet: +- New paragraph ---+ | Select paragraph type:| | [ Text paragraph |V]| | [ Insert paragraph ] | +---+ Yet another use case: A web application allows a user to order e.g. an insurance. The price depends on a lot of things, and not all calculation and user validation can be done client-side. Before ordering, the user may want to select different product options and calculate a price before making the actual order. In this case, the specified options are sent to the server for calculation, but the other fields are just silent passengers on the round-trip, so that the fields keep their values after the post-back. This also applies in e.g. a CMS where the user fills out a template and is able to get a preview using a post-back. It would be convenient to allow previews even though not all required data has been entered yet. Christian
Re: [whatwg] WF2: Non-validating submit buttons
Hi, From: Alexey Feldgendler [EMAIL PROTECTED] However, this doesn't solve the use case of saving an unfinished form server-side. Are there any real-world examples where you can save an unfinished form on the server and continue filling it afterwards, that also has required fields (when the form is finished)? I have never seen such a form. Regards, Simon Pieters _ Tjäna pengar - sälj på auktion http://tradera.msn.se/
Re: [whatwg] WF2: Non-validating submit buttons
On Wed, 24 Jan 2007 21:55:16 -, Simon Pieters [EMAIL PROTECTED] wrote: However, this doesn't solve the use case of saving an unfinished form server-side. Are there any real-world examples where you can save an unfinished form on the server and continue filling it afterwards, that also has required fields (when the form is finished)? I have never seen such a form. Saving incomplete forms is a recommendation in cite isbn=0-7357-1410-X ;) Devensive Design for the Web/cite which provides www.bankone.com as an example site that saves incomplete applicatios (I don't know however if that's via save button or just up to the last completed step). IMHO non-validating button makes sense for saving drafts of various kinds (webmail, blog post, wiki page). Another use-case is a preview button. Example: comment submission on a blog. You may require users to fill-in their name and e-mail address, but these fields aren't neccessary to display a preview of text formatting. -- regards, Kornel Lesiński