Link to home
Start Free TrialLog in
Avatar of KCTechNet
KCTechNetFlag for United States of America

asked on

alert default to no

I am using the code below to show an alert when the 'clear form' button is pushed.  I would like it if 'no' is defaulted when the user hit enters because now if they hit enter the clear runs.  Or would it be possible to have nothing happen with the enter key, only a mouse click?
var nRslt = app.alert ("This will clear what is entered in all the fields in\n\n" +    "Are you sure?";,1, 2, "Submit Validation");
 
if(nRslt == 4){     //put the clear code here}

Open in new window

Avatar of TommySzalapski
TommySzalapski
Flag of United States of America image

What language is this? Flex?
If it's flex, then the alert takes seven parameters, the last one is the default button.
Look up the alert() function for whatever language you are using. There should be a default button option, set that to the value of the No button. In Flex it would look something like:
Alert.show('Message', 'Title', mx.controls.Alert.YES | mx.controls.Alert.NO, null, null, null, mx.controls.Alert.NO)
Avatar of KCTechNet

ASKER

javascript in a PDF form
ASKER CERTIFIED SOLUTION
Avatar of TommySzalapski
TommySzalapski
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I will check out the custom dialog or perhaps word it differently as suggested.

Thanks for your time