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

Save an empty field in the backend taking a default value

Amie
Registered: Sep 7 2009
Posts: 17

Hi all,

I've a requirement wherein i have a mandatory field for country. If the user doesn't fill the field, it is supposed to take up an default value and save at the backend while the user clicks on check and save.

Can you help me out as to how can i acheive it using formcalc.

Regards,
Amie

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You can use a script in the exit event of the field:

if ($.rawValue == null) then$.rawValue = "Put In Your Default Value Here"else$.rawValueendif

For your check and save button you then need a script that checks the value of the country field for the default value.
if (..country.rawValue == "Your default value") thenxfa.host.messageBox("Please select a country", "Error", 3, 1)endif

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs