These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Set Upper Case or Lower Case by default

ebbo1983
Registered: Mar 16 2009
Posts: 93

This relates to a thread i made earlier (http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=20832) and i solved the problem. But i have come to an additional problem.

I have a field called owned_t1 which checks if the value of the Field is "YES" or "NO" or "yes" or "no".

if it the match is found nothing happens, if no match is found then the user will be prompted with an error message asking them to enter yes or no.

The only problem i have with this is if the user Enters Yes or yEs or yES or YeS the form will prompt the user with the error as it does no match exactly as above. To get around this I would either like to:

1) set the field to capital letters by default
2) upon exiting the field set the string to uppercase and then check to see if the condition is met. (please see my other thread)

These must be done with FormCalc! unless some1 can provide a Javascript alternative to my code in the other thread:)

My Product Information:
LiveCycle Designer, Windows
ebbo1983
Registered: Mar 16 2009
Posts: 93
Solved....keep getting stuck and finding the solutions throuhg trial and error

----- form1.table1_rows.owned_t1::exit: - (FormCalc, client) ---------------------------------------

this.rawValue = Upper(owned_t1.rawValue)

if (owned_t1.rawValue == "YES" | owned_t1.rawValue == "NO")
then
owned_t1.access = "open"
else
$host.messageBox("please enter valid value either yes or no")
$host.setFocus("xfa.form.form1.table1_rows.owned_t1")
endif----- form1.table1_rows.owned_t1::docReady - (FormCalc, client) ------------------------------------

if (HasValue(form1.table1_rows.description_t1)) then
owned_t1.rawValue = "YES / NO"
owned_t1.access= "open"
endif
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
One does this by changing the value of the field to all UPPER or lower case. FormCalc has the 'Upper()" and 'Lower()' string functions.

if (Lower(owned_t1.rawValue) == "yes" | Lower(owned_t1.rawValue) == "no")thenowned_t1.access = "open"else$host.messageBox("Please enter a valid value - either Yes or No")$host.setFocus("xfa.form.form1.table1_rows.owned_t1")endif

Or use an exit script to set the field format as desired for the input field.
$.rawValue = Upper($.rawValue)

George Kaiser