KCTechNet
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}
ASKER
javascript in a PDF form
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I will check out the custom dialog or perhaps word it differently as suggested.
Thanks for your time
Thanks for your time
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)