I am looking for a checkbox to create for the client. It will have three possibilities-On/off/neutral.
The On should be a "Check" mark.
The Off should be a "Cross" mark.
Lastly for the NA state, a "blank" selection or "NA" for the third.
I am unable to get any result. Could somebody please provide me with the code or a sample pdf to make this work.
Solved! Go to Solution.
If I understand your question, you want to cycle through the same checkbox and want the icon in the checkbox to change between check, cross and an empty box?
If that is the case I managed to achieve that functionality with this code in the change event of the checkbox.
if (this.ui.oneOfChild.mark === "check" && this.rawValue == 0){ | |
this.ui.oneOfChild.mark = "cross"; | |
this.rawValue = 1; |
}
else if (this.ui.oneOfChild.mark === "cross"){
this.ui.oneOfChild.mark = "check"; | |
this.rawValue = 0; |
}
(the checkbox should be setup as a "on/off" checkbox with the "check" Check Style from the start).
This is a bad/ugly way of doing it, but it was the first that came to mind for me. However, this will cause you some extra issues if you have some form dependancies of this checkbox? As you wont have a "rawValue" for each state. But in that case I would rather use the "ui.oneOfChild.mark" property as an identifier of the state (or possibly set up an hidden numeric field that changes into a numeric identifier that changes in the actual change event.
If this answer was helpful, please mark it as correct, and if something is weird or if you just have any questions on the code, please feel free to ask.
Regards, Mattias.
There is no type of check box that behaves that way. You can fake it using buttons and JavaScript, as demonstrated in the following sample: http://acroscript.net/pdf/demos/multistate_4.pdf
You'll have to study it to see how it works. Note that you can only rely on this technique working with the desktop versions (Windows/Mac) of Adobe Reader and Acrobat, not other PDF viewers, mobile viewers in particular.
Views
Replies
Total Likes
Hello,
this is something that could help me a lot. Can you send me the scripts for the last two buttons. ??
Views
Replies
Total Likes
I am using designer 6.1 to complete the form.
Views
Replies
Total Likes
The code is in the file, most of it in document-level JavaScripts. The same thing won't work with LiveCycle Designer form, but there is a forum for it where you should ask about what's possible: LiveCycle Designer
Views
Replies
Total Likes
if (this.rawValue === 1) {
this.ui.oneOfChild.mark = "check";
}
if (this.rawValue === 2) {
this.ui.oneOfChild.mark = "cross";
}
All I got till now is this, which does not work for me for some reason. Can you take a look at my form.
Views
Replies
Total Likes
No, I don't think we can take a look at your form. You need the LiveCycle Designer forum as we said.
Views
Replies
Total Likes
[Question moved to the LCD forum]
Views
Replies
Total Likes
If I understand your question, you want to cycle through the same checkbox and want the icon in the checkbox to change between check, cross and an empty box?
If that is the case I managed to achieve that functionality with this code in the change event of the checkbox.
if (this.ui.oneOfChild.mark === "check" && this.rawValue == 0){ | |
this.ui.oneOfChild.mark = "cross"; | |
this.rawValue = 1; |
}
else if (this.ui.oneOfChild.mark === "cross"){
this.ui.oneOfChild.mark = "check"; | |
this.rawValue = 0; |
}
(the checkbox should be setup as a "on/off" checkbox with the "check" Check Style from the start).
This is a bad/ugly way of doing it, but it was the first that came to mind for me. However, this will cause you some extra issues if you have some form dependancies of this checkbox? As you wont have a "rawValue" for each state. But in that case I would rather use the "ui.oneOfChild.mark" property as an identifier of the state (or possibly set up an hidden numeric field that changes into a numeric identifier that changes in the actual change event.
If this answer was helpful, please mark it as correct, and if something is weird or if you just have any questions on the code, please feel free to ask.
Regards, Mattias.
Thanks a ton for your effort, but what I am getting is still a check, check and blank response. I followed your exact steps.
Views
Replies
Total Likes
Hmm okay, that's strange as it has the correct behaviour for me.. I have no clue as to why it would differ between the versions (I am sitting in Designer ES2). Do you have the possibility to upload your form and share the link here so I can have a look? Otherwise I can try make this code a bit more "rigid" aswell.
Views
Replies
Total Likes
And just to make sure you have everything set up the same way as I do.
1. Do you have the script on the "change event" of the checkbox?
2. Is the Check Box set up as a on/off check box with the "Check" check style? (field palette)
3. Do you have the "On Value" as 1 and the "Off Value" as 0 ? (binding palette)
Views
Replies
Total Likes
Nope, it is not working and yes, I have put the script in the change event of the checkbox, and the rest as you mentioned. I also have designer es2, but I am not getting the same output as you.
Can you send me the pdf you worked on??
Views
Replies
Total Likes
Yes, I think it will be easiest if you give me your mail and I will mail the example I have worked on. If you would prefer not to post it, you could just send an PM or something to me with your mail address.
Views
Replies
Total Likes
Views
Replies
Total Likes
Yes, I have sent it, please let me know if it works for you
Views
Replies
Total Likes
THANK YOU SO MUCH!
Views
Replies
Total Likes
No problem, happy to help
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies