Hello,
I'm using the response dialog box and i have to know if the user has pressed cancel or ok.
For the moment i can't see how to do that when the response is empty.
I've seen in documentation that null is returned if cancel button is pressed but for me it's always en empty string.
Here is my script :
var response = xfa.host.response("reponse dialog box","",);
var nullCheck = (response == null);
var emptyCheck = (response == "");
xfa.host.messageBox( "nullCheck is " + nullCheck);
xfa.host.messageBox( "emptyCheck is " + emptyCheck);
//xfa.host.messageBox( "response is " + response);
xfa.host.messageBox(response);
Somebody somewhere has an explanation ?
Philippe Vandenhove
Views
Replies
Total Likes
The problem is in the 1st line .....there is no xfa.host.response function .....it is a function of the app object in Acrobat so the co
mmand would be:
app.response("This is the message I want to show");
If you are using Acrobat you can see any Javascript runtime errors by clicking Ctrl+j and bring up the Javascript console. This will indicate if there are issues in your script.
Paul
Views
Replies
Total Likes
Here is the documentation of the function:
I use adobe reader and i see no error message.
The dialogs box are displayed correctly.
My problem is that i don't know if the user has clicked OK or CANCEL if the value entered is a an empty string.
Regards
Views
Replies
Total Likes
If they hit Cancel then you get a null back .....if they hit OK but do not fill out the input then you get an empty string "".
Paul
Views
Replies
Total Likes
Perhaps my check (response == null) is wrong but it seems that i don't received a null value.
Variable nullCheck is always set to false.
var response = xfa.host.response("reponse dialog box","");
var nullCheck = (response == null);
var emptyCheck = (response == "");
xfa.host.messageBox( "nullCheck is " + nullCheck);
xfa.host.messageBox( "emptyCheck is " + emptyCheck);
//xfa.host.messageBox( "response is " + response);
Regards,
Views
Replies
Total Likes
Works fine for me ...i changed the name of the variable from response to response1 beacuse I was concerned that response might be a reserved word.
Paul
Views
Replies
Total Likes
For me the null check is always false. I use Adobe Reader 9.3.0 and Adobe LiveCycle Designer ES 8.2.1.3158
Views
Replies
Total Likes
From the for what's its worth department:
When using == to test for null, "" and 0 will return (true)
When using === to test for null "" and 0 will return (false)
Stephen
Views
Replies
Total Likes