Hi, I have been trying to create a popup dialog box to tell users to fill in certain form fields. I don't know Java so I have been using a script that I found in the forums, but I need to be able to modify the text. Can anyone tell me how to do this? Here is the script. Thanks.
var requiredFields = [], error = "";
for (var i = 0; i < numFields; i++) {
var fName = getNthFieldName(i);
var f = getField(fName);
if (f.type !== "button" && f.required && !f.valueAsString) {
requiredFields.push(fName);
error += fName + "\r";
}
}
if (error) {
app.alert("Please complete the following fields: \r\r" + error, 3);
getField(requiredFields[0]);
} else {
}
Hi George, currently this script creates a popup dialog box with the following text: Home telephone number, mailing address, name, position applying for, residence address, social security number and work telephone number. These are the first set of text fields in my form. I would like to have two more popup boxes for other sections that would have the following text: popup 1: Convicted of a violation other than a minor traffic violation and Removed from any type of employment. Popup 2: U.S. Citizen, N.Y. Driver's License, Part-time work, Legal right to work in U.S., and Temporary work. I tried to figure out how the script above created the list of home telephone number, mailing address, name, position applying for, residence address, social security number and work telephone number for the popup dialog box but I'm afraid that it was beyond me. Any help would be greatly appreciated. Thanks
The script currently gets that text from the field names. What you want would make for rather long field names, but the script could be changed to use the field's tooltip text instead, or you could do something like set up an array to associate field descriptions with field names. So what will work with the current script is to simply change the field names to suit your needs, but I would personally use one of the other approaches. Post again if you need more help.
The current script is really just for text fields, so it would have to be modified to work with check boxes, radio buttons, list boxes and dropdowns. With radio buttons, either none can be selected by default or one could be, indicating that a valid option has not been selected. I would have to know how you have the radio button group set up to suggest some code you could use.
North America
Europe, Middle East and Africa
Asia Pacific