Copy link to clipboard
Copied
Hi, I have a script, that tests for an * in a tooltip, if it is theree, the field is required.
Sometimes a required field is hidden, based on choices made.
I want the script to test for hidden fields as well and ignore any field that is hidden.
function validateFields()
{
//a counter for the number of empty fields
var flg = 0
// count all the form fields
var n = this.numFields
//create an array to contain the names of required fields
//if they are determined to be empty
var fArr = new Array();
//loop through all fields and check for those that are required
// all fields that have a '*' in their tool tip are required
for(var i = 0;i<n;i++){
var fn = this.getNthFieldName(i);
var f = this.getField(fn);
//tool tip is the fields\'s 'userName' property;
var tt = f.userName
//test for the '*';
if(tt.indexOf('*')!=-1 && f.value == f.defaultValue){
//increment the counter of empty fields;
flg++;
//add the fields userName (tool tip) to the list of empty field names;
fArr[fArr.length] = tt;
}
}
Copy link to clipboard
Copied
Change that one line to:
if (tt.indexOf('*') != -1 && f.value == f.defaultValue && f.display !== display.hidden){
Copy link to clipboard
Copied
Change that one line to:
if (tt.indexOf('*') != -1 && f.value == f.defaultValue && f.display !== display.hidden){
Copy link to clipboard
Copied
a different way. I have a hidden field, will never be seen, but if hovered over, I want the tool tip to show?
Copy link to clipboard
Copied
Not possible.
Copy link to clipboard
Copied
interesting. Ok, so I have some header text If you put your mouse over it, I want a tool tip to pop up. Since text does not need it, I thought of a field.
Would you know how to do that? I know it seems weird, but I need to do it.
Thanks
Copy link to clipboard
Copied
You can use a visible button field that doesn't do anything when clicked, but not a hidden or read-only field.