Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2008

Tip: Looking for answers? Try searching our database.

Validation of datepicker value and whitespace characters...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
educos - 26 Mar 2008 13:02 GMT
Hi,

I meet a global problem in my infopath form in validation rules. I can easy
reproduce this problem with date picker.

If I put a date picker control in a form, I can tape in some space
characters in the text field and when I loose focus, infopath give me back a
validation error (because there is a "not empty value" that does not meet a
date form). If I click again in the text field, I do not see the spaces
because for some strange behaviour, infopath removes unwanted spaces....but
the spaces are stil present in the XML representation, so the user may not
understand why there is an error.

The same thing happen in normal text field if use the validation rule "field
is not empty". This rule become true if user inpu some space characters in
the field...but for me the value is still empty...

So, my question: is there an easy way to avoid this behavior...

Best regards.

Eric.
Clay Fox - 26 Mar 2008 16:24 GMT
You could add a conditional rule or to that after change the field was spaces
that it would set it to empty string or a default or something. You could
check if it was a valid date format, yyyy-mm-dd or whatever and if it was not
then reset the field.

Signature

Clay Fox / Microsoft InfoPath MVP
www.InfoPathDev.com / The InfoPath Authority / Downloads, Samples, How-To,
Experts, Forum

> Hi,
>
[quoted text clipped - 18 lines]
>
> Eric.
educos - 26 Mar 2008 16:44 GMT
Hi Clay,

I already had such an idea. If I had only one or two such fields, that would
be no problem....but the form I work on has more than 40 fields with cross
validation rules...

Another situation that I met is the following:
I have two fields (txtField1 and txtField2) and I have put a validation rule
so that when the user put something in one of the two fields, he must put
something in the other field. To do that, I defined a "validation rule" on
each field with such condition:
- txtField1 is empty AND txtField2 is not empty on txtField1
- txtField2 is empty AND txtField1 is not empty on txtField2
but now, if user put a space character in txtField1, the txtField2 is
marqued as an error (with a red star) and yet txtField1 is empty (for the
user point of view).

I think there is a bug of incoherence between the data stored in XML and
data displayed in the form. If a field is displayed "blank", the value of the
field in XML should be considered as empty...here is not the case.

Regards.

Eric.

Signature

Cordialement.
Eric.

> You could add a conditional rule or to that after change the field was spaces
> that it would set it to empty string or a default or something. You could
[quoted text clipped - 23 lines]
> >
> > Eric.
Clay Fox - 26 Mar 2008 16:57 GMT
Hey Eric.

Yah validation is a pain.

Sounds like these users like their space bar.

Some times you can create a hash type field.

Say for your 40 dates, have one field that concatenates them all into one
string.
Then use a contains to check for any spaces. If the field is blank it will
be skipped but if it has space that would get concatenated in and you could
detect it. Unfortunately you cannot say which field but you can block the
user until they get their dates cleaned up.
This probably would not work on your text fields, for those I would check
them for a space and then reset them to empty.

Signature

Clay Fox / Microsoft InfoPath MVP
www.InfoPathDev.com / The InfoPath Authority / Downloads, Samples, How-To,
Experts, Forum

> Hi Clay,
>
[quoted text clipped - 48 lines]
> > >
> > > Eric.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.