#1
|
|||
|
|||
Test Field Contents
Hi
I have a "partial" solution to compare text Form Field empty content, the trick is compare to six ? wildcards and one * wildcard: {IF {textFormFieldName} = "??????*" "Field is not empty" "Field is empty"} The problem is it only detect string with six characters minimum. |
#2
|
||||
|
||||
The behaviour is by design - each '?' represent exactly one character, but the '*' represents any number of characters. The question is why are you using such a construction to test whether a field is empty, when that should be done with code like:
Field is {IF{REF textFormFieldName}<> " " "not "}empty A field that contains at least six characters cannot be empty...
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Quote:
Easy, because: {IF{REF textFormFieldName}<> "" "not "} ...not working. That is the origin of this thread. This trick was useful in my case. |
#4
|
||||
|
||||
Unless you've changed the defaults, an 'empty' text formfield will have exactly 5 spaces - it cannot have 6 or more characters. Hence, to test whether a text formfield is 'empty', you'd use:
Code:
Field is {IF{REF textFormFieldName}<> " " "not "}empty
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Excellent! That is most precisely.
Although this behavior is evidently a Word bug. Thanks. |
#6
|
||||
|
||||
No, it is not a Word bug. Doubtless, the behaviour was originally documented - Word formfields have performed this way for decades.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Student's t-test (T.TEST): how to get p value? | seanspotatobusiness | Excel | 1 | 07-20-2018 05:46 AM |
Include Table of Contents by Mail Merge Field | vandelayindies | Mail Merge | 1 | 01-08-2018 03:06 PM |
Contents Page Field Formatting | hdmackay | Word | 17 | 01-12-2017 01:44 PM |
Table of contents not displaying custom text in field | wrdy | Word | 3 | 01-05-2015 02:57 AM |
unable to send test message Please verify the email address field | jarv | Outlook | 0 | 04-30-2010 07:15 AM |