Copy link to clipboard
Copied
Hi,
I have custom dialog box based on java script code that prompts the user to enter data for an exhibit label. This label is then annotated on the pdf. As a first step, I want to force the user to Select a Label Format from a drop down list. The choices in this drop down list are "Exhibit", "Attachment", and "Memo". I want it so they cannot move to the next step without making this selection. How do I do this?
Thx.
S
Copy link to clipboard
Copied
That's not possible in a Dialog object. Instead you can use the validation event of the object to not allow them to continue if not selection is made when they click OK.
Copy link to clipboard
Copied
Can you advise? I have no idea how to use a validation event. Would this be written into the java script code?
Copy link to clipboard
Copied
Read the documentation of the Dialog object (under the execDialog method). It has a built-in function called "validate" that does just that.
Copy link to clipboard
Copied
This may not be a welcome answer, but this is not considered normal or good form design. Consider a paper form. People can fill it in, in any order, stop and come back later to answer more difficult questions. They demand the same flexibility from computer forms. Users fill in many forms online and using different conventions makes then inefficient and irritated, neither is a good objective.
Now, there are several ways of dealing with the fact that something is required.
1. Make it a required field. When the form is submitted, it will not submit with non-required fields.
2. If part of the form makes no sense until an earlier part of the form is filled in, make the dependent fields invisible or greyed out until the first choice is made.
3. If the form is saved or printed rather than submitted properly, your choices are very limited anyway, but you can use a script to render the copy/printout obviously incomplete, such as an otherwise invisible field saying so in big letters.
Copy link to clipboard
Copied
Sorry, I see it is a dialog rather than a form. This gives more and less flexibility. You can reject the OK if the form is not complete. Or you can grey It out (but this causes a surprising - to me - amount of confusion). You can divide the dialog in two if the later choices really do depend on the first. But consider carefully what you are trying to do. In a dialog you have even less control over where people click and type than in a form, and that's considered a good thing.
Copy link to clipboard
Copied
There is nothing more annoying than a form where it's not clear what you need to do to get to the next step. It's almost like a game where you have to solve some problems before the next level becomes available
What I've done in the past is to have one static text field at the bottom of the dialog, right next to a grayed out "OK" button that would instruct the user about what the requirements were for enabling the button. If you have sections of the form where information depends on previous selections, you could disable these as well, but again, when you do that, make it clear why it's disabled, and what the user needs to do in order to enable such a section (e.g. add a static text element "Only necessary if ABC is selected")
Find more inspiration, events, and resources on the new Adobe Community
Explore Now