W3C home > Mailing lists > Public > www-forms@w3.org > February 2006

Re: required fields + alerts

From: David Landwehr <david.landwehr@solidapp.com>
Date: Mon, 27 Feb 2006 09:58:33 +0100
Message-ID: <4402BF39.7020308@solidapp.com>
To: Emiliano Moscato <moski666@gmail.com>
Cc: www-forms@w3.org

Hi Emiliano,

1) There is no good way of displaying such a message. The only 
indication you will get is that the submission element will dispatch 
xforms-submit-error which it does for whatever reason the submission can 
fail, e.g. validation error, network error, required fields not filled 
out and so on. Otherwise you would have to build a very special form 
which calculates the number of required fields that are empty, it will 
be clumsy and difficult to maintain.

2) Correct, it is caused by the empty boolean. xsd:boolean is required 
to have a value of either 0,1,true or false.

Best regards,
David


Emiliano Moscato wrote:
> Hi!
>
> 1) Is there a way to give an alert when the user attempt to submit a 
> form without filling a required field?
> I'm using firefox 1.6a2 with the latest nightly build of the XForms 
> plugin (0.4) and the following example doesn't works as I spected to.
>
> 2) The field marked as boolean starts as
> invalid, is it right? I supose it's because the model instance is 
> empty and this empty field does not match with the boolean type (as an 
> empty string match whith the string type).
>
> Thanks a lot,
>
> Moski
>
>
>
>
> ------------------------------------------------------------------------
>
> empresa
> ------------------------------------------------------------------------
>
> Es una persona particular? Está mal completado el campo 'Es una 
> persona particular?'
>
> Nombre_de_fantasia Está mal completado el campo 'Nombre_de_fantasia'
>
> Enviar
> ------------------------------------------------------------------------
>
> body{
>     background-color: #FFFFFF;
>     margin: 20;
>     padding: 0;
>     color:#444444;
> 	font-family:sans-serif, Arial, Helvetica;
>     font-color: red;
> }
>
>
> @namespace xforms url(http://www.w3.org/2002/xforms);
> /* Display a red background on all invalid form controls */
> *:invalid { background-color:red; }
> /* Display a red asterisk after all required form controls */
> *:required::after { content: "*"; color:red; }
> /* Do not render non-relevant form controls */
> *:disabled { visibility: hidden; }
> /* The following declarations cause form controls and their labels
>    to align neatly, as if a two-column table were used */
> xforms|group { display: table; }
> xforms|input { display: table-row; }
> xforms|input > xforms|label { display: table-cell; }
> xforms|input::value { border: thin black solid; display: table-cell; }
> /* Display an alert message when appropriate */
> *:valid   > xforms|alert { display: none; }
> *:invalid > xforms|alert { display: inline; }
> /* Display repeat-items with a dashed border */
> *::repeat-item { border: dashed; }
> /* Display a teal highlight behind the current repeat item */
> *::repeat-index { background-color: teal; }
>
>
>
>
>
>   


-- 
--------------------------------------------
David Landwehr (david.landwehr@solidapp.com)
Chief Executive Officer, SolidApp
Web: http://www.solidapp.com
Office: +45 48268212
Mobile: +45 24275518
--------------------------------------------
Received on Monday, 27 February 2006 08:58:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:03 GMT