|
|
| Author |
Message |
complete_noob
 Total Messages 5
|
| Subject: | Alerts & Changing Drop Down Box Choice |
I have a drop down box with the abbreviations for all 50 states.
For Alaska (AK) & Hawaii (HI) I want an alert to pop up ONLY when those two states are selected advising the form filler that UPS 2nd day must be used.
Then I want another drop down box with the different delivery type choices for UPS to automatically change to "UPS 2nd Day Air" - again, ONLY when AK & HI are selected.
Thank you so much for taking the time to read and possibly assist!
complete_noob
| Posted: 06 Apr 2011 09:37 PM |
|
|
| |
jkitzy
 Total Messages 94
|
| Subject: | Alerts & Changing Drop Down Box Choice |
Hey noob! Here's what I would do...
First, you need to make sure DropDown1 is set to Commit selected value immediately. It's under Properties/Options.
Second, add a keystroke event (Properties/Format/Custom/Custom Keystroke event) for DropDown1:
////////////////////////////
if(event.willCommit&&(event.value=="AK"||event.value=="HI")){
app.alert("You must use UPS Second Day Air when shipping to Alaska or Hawaii!")}
////////////////////////////
Then, in the DropDown2 calculation event, do this:
////////////////////////////
var b = this.getField("DropDown1").value
if(b=="AK"||b=="HI"){event.value = "UPS Second Day Air"};
////////////////////////////
That should make it reasonably foolproof.
---jak
| Posted: 08 Apr 2011 07:37 AM |
|
|
| |
complete_noob
 Total Messages 5
|
| Subject: | Alerts & Changing Drop Down Box Choice |
wow! Great! Many thanks for your help.
da noob
| Posted: 10 Apr 2011 06:33 PM |
|
|
| |
complete_noob
 Total Messages 5
|
| Subject: | Alerts & Changing Drop Down Box Choice |
wow! Great! Many thanks for your help.
da noob
| Posted: 10 Apr 2011 06:33 PM |
|
|
| |
complete_noob
 Total Messages 5
|
| Subject: | Alerts & Changing Drop Down Box Choice |
wow! Great! Many thanks for your help.
da noob
| Posted: 10 Apr 2011 06:33 PM |
|
|
| |
complete_noob
 Total Messages 5
|
| Subject: | Alerts & Changing Drop Down Box Choice |
jkitsy,
Thanks again for your help but....I am stumped.
I use Acrobat 8 Livecycle.
I cannot find where to complete this instruction:
Second, add a keystroke event (Properties/Format/Custom/Custom Keystroke event) for DropDown1:
Can you point this noob towards water?
| Posted: 11 Apr 2011 07:13 PM |
|
|
| |
jkitzy
 Total Messages 94
|
| Subject: | Alerts & Changing Drop Down Box Choice |
Ouch. I usually only use Acrobat Forms instead of diving into Livecycle. Let me see if I can figure out how you'd do this in Livecycle or see if someone more familiar with it can answer...
---jak
| Posted: 12 Apr 2011 08:25 AM |
|
|
| |
jkitzy
 Total Messages 94
|
| Subject: | Alerts & Changing Drop Down Box Choice |
Okay. I may have this figured out. Again, let me preface this with: I'm not an expert in the LiveCycle FormCalc script. However, here goes.
First, make sure the States are named DropDown1 and the shipping is DropDown2. You can change those names in the script if they're not yours.
Second, make sure DropDown1 is set to commit on Select (Object/Field)
Then, in the Calculation script (and this is in FORMCALC, not JavaScript...) put this:
/////////////////////////
var ch = DropDown1
if (DropDown1=="AK" | DropDown1=="HI") then
xfa.host.messageBox("You must use UPS Second Day Air when shipping to Alaska or Hawaii!")
DropDown2="UPS Second Day Air"
endif
DropDown1=ch
/////////////////////////
See if that works. It worked for me, but again, I'm no expert in FormCalc or LiveCycle. Yet! :)
---jak
| Posted: 12 Apr 2011 09:26 AM |
|
|
| |
|
|