• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

hidden required field

Participant ,
Jul 11, 2018 Jul 11, 2018

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;

}

}

TOPICS
PDF forms

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
LEGEND ,
Jul 11, 2018 Jul 11, 2018

Copy link to clipboard

Copied

Change that one line to:

if (tt.indexOf('*') != -1 && f.value == f.defaultValue && f.display !== display.hidden){

View solution in original post

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 11, 2018 Jul 11, 2018

Copy link to clipboard

Copied

Change that one line to:

if (tt.indexOf('*') != -1 && f.value == f.defaultValue && f.display !== display.hidden){

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 19, 2019 Jun 19, 2019

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2019 Jun 19, 2019

Copy link to clipboard

Copied

Not possible.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 19, 2019 Jun 19, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2019 Jun 19, 2019

Copy link to clipboard

Copied

LATEST

You can use a visible button field that doesn't do anything when clicked, but not a hidden or read-only field.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines