Copy link to clipboard
Copied
Below are this the question from my form. I have a radio button Yes/No set (named HMDA) and I want to force the applicant to answer the question without being able to skip over it. I wrote the below code but it doesn't work properly. If the applicant tries to skip the question an alert will appear letting them know they have to answer the question. When they click ok to dismiss the alert - if they answer yes to the question my script works fine and they can move on to the next question on the form. However, when they click ok to dismiss the alert - if they try to answer No to the question the alert appears again and they click ok to dismiss the alert then the No button will populate and then applicant can move on.
Script for my Question:
if(getField("HMDA").value=="Off")app.alert("If the applicant is an individual, is the collateral offered a residential dwelling? Please select Yes or No",1,0,"HMDA ERROR")
Also, how do I get rid of the Warning: "JavaScript Window" on my alert?
The error message is an Adobe's anti-spoofing mechanism. In order to get rid of it the code has to be run from a privileged (trusted) location,i.e. not a document script.
You can read more about trust and privilege here:
Copy link to clipboard
Copied
There is a way to do this, it's just complicated. For example, you can add On Focus script to every field on the form.
This script would save the name of the field that has the focus and use this saved value to decide whether or not the field focus is changing on a required field. For example, if the saved name and the current name are the same it would do nothing. But if they are different and the saved name was a required field, and didn't have a value, it displays the warning.
Copy link to clipboard
Copied
Can you provide me an example of what the script would say?
Copy link to clipboard
Copied
This is not a simple script. Would you be willing to pay for it?
Copy link to clipboard
Copied
Thanks for your help with this but I figured out how to make the app.response box actually populate the field with with the response from the alert.
Copy link to clipboard
Copied
Yes, but "tab through a question" doesn't mean anything when the user can just click past it. You need to move from the concept to exactly what you want to happen, realising that PDF forms haven't been designed to enable this easily. You have to forbid actions in all successor fields after checking conditions. Consider too that fields have more than one action type, choose carefully.