Ask a Question related to Adobe Acrobat Windows, Design and Development.
-
Steve_Egge@adobeforums.com #1
javascript help needed: Trapping "null" from pop up menu so it doesn't display
I am making some interactive forms which use the app.popUpMenuEx routene to make a pop up menu.
When the menu is clicked on incorrectly ... the word Null is returned and is visable on the form field.
I would like to "trap" this so it is not visable, leaving the form blank so someone could tab into the field and type an alternative if it isn't present on the pop up menu.
Could someone help me with this ... here is what I have
var x = this.getField ("med") //define field variable x
cChoice = app.popUpMenuEx
(
{cName:"Flovent 44 MDI"},
{cName:"Flovent 110 MDI"},
{cName:"Flovent 220 MDI"}
)
med.value = ""+ cChoice +""
OK ... now I tried to trap the null so it wouldn't display by trying this ... but I'm doing something wrong. (javascript newbie)
if (""+ cChoice +"" == null)
then (med.value = " ")
else (med.value = ""+ cChoice +"")
but that doesn't work ...
Can anyone skilled at javascript help me so that the word null doesn't display if the pop up menu is exited incorrectly
Thanks ...
Steve Egge MD
Steve_Egge@adobeforums.com Guest
-
"Page" and "Rect" props of the Field prop in Javascript API
Page property of the Field property in Javascript Acrobat API returns an array of pages that this field exists in. On the other hand, "rect" property... -
cfqueryparam ignores null="yes" when list="yes"
I get an unexpected result when using cfqueryparam with list="yes" and null="yes" using CF 7.0.1 and MSSQL 2000. When i run this code: <cfset... -
"save", "selective color" menu go too slow. Please help!
have intel pentium 4 cpu and photoshop 7. when im using "selective color" or "save" menu (im a novice of photoshop), i have to wait kind of long... -
"Start" "Program" "Menu" list is empty
For what ever reason my list of installed programs in my "Start" "Programs" menu is empty. Anyone know how to restore the list. Thanks for your... -
Attaching "OnClick" Javascript code to dhtml popup menu links
I am currently developing a web site using fireworks, and am trying to figure out a way (through hand-coding) of attaching a javascript function... -
George_Johnson@adobeforums.com #2
Re: javascript help needed: Trapping "null" from pop up menu so it doesn't display
var x = this.getField ("med") //define field variable x cChoice = app.popUpMenuEx
( {cName:"Flovent 44 MDI"}, {cName:"Flovent 110 MDI"}, {cName:"Flovent
220 MDI"}
That should be: var cChoice = app.popUpMenuEx...
med.value = ""+ cChoice +""
You don't want to do that yet, and no need to add the empty strings.
if (""+ cChoice +"" == null)
There's no way that will equal null, since you're adding the empty strings. Do this:
if (cChoice == null)
then (med.value = " ")
There is no "then" keyword in JavaScript.
else (med.value = ""+ cChoice +"")
The code might look like this:
if (cChoice == null) med.value = "";
else med.value = cChoice;
George
George_Johnson@adobeforums.com Guest



Reply With Quote

