3 Replies Latest reply on Jan 17, 2018 2:27 AM by The Waugh

    Script to detect unfilled fields wont detect unfilled drop downs, please help!

    The Waugh Level 1

      I'm used the script below to detect unfilled fields on my forms. It works great however it can't detect unfilled drop downs they are set to be required. Any help would be greatly appreciated!


      var emptyFields = [];



      for (var i=0; i<this.numFields; i++) {



           var f= this.getField(this.getNthFieldName(i));



           if (f!=null && f.type!="button" && f.required ) {



                if ((f.type=="text" && f.value=="") || (f.type=="checkbox" && f.value=="Off")) emptyFields.push(f.name);









      if (emptyFields.length>0) {



           app.alert("Error! You must complete the following fields:\n" + emptyFields.join("\n"));