W3C home > Mailing lists > Public > www-forms@w3.org > November 2003

xform validations problems

From: Raghu Krishnamurthy <raghu.krishnamurthy@oracle.com>
Date: Thu, 27 Nov 2003 11:46:23 +0530
Message-ID: <3FC596B7.354A09B1@oracle.com>
To: www-forms@w3.org

I have an xforms document that has a few text fields.
The different validations are that textbox1 should be mandatory,
textbox2 should be only a date and textbox3 should contain less than 10

I have the constraints defined thus
<xforms:bind nodeset="/my:Eform/my:Summary" required="true()"
<xforms:bind nodeset="/my:Eform/my:Referral.Rejected.-.Reasons"
id="bind_8" type="xsd:date" format="YYYY-MM-DD"/>
<xforms:bind nodeset="/my:Eform/my:Desired.Outcome.of.the.Service"
id="bind_4" constraint="string-length( normalize-space(.) ) &lt;

The ui would be as follows
<xforms:textarea id="input_0" rows="1" cols="80"
                                <xforms:label id="label_1"><span
                                         This is a mandatory field

Now the problem I have is that as you can see in the
<xforms:message ev:event="xforms-invalid">
            This is a mandatory field

the event gets fired whenever the instance is invalid.
This is fine,but when the form is displayed for the first time to the
user,the instance will be an empty instance as the fields would not
contain any data.
like <Summary></Summary>
So when the form is first time displayed to the user,these alerts come
up while rendering the form as the instance data would not comply with
the constraints set.
Ideally I want the form to display without any alerts and when the user
enters data and then tabs out to other fields or hits the submit
button,I want the alert messages to be displayed and not while  the form
is getting rendered.
Would anybody  please let me know how to do that?

Thanks and Best Regards

Received on Thursday, 27 November 2003 03:22:05 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:10 UTC