Skip navigation
Currently Being Moderated

Help with Script

Aug 29, 2012 9:03 AM

Hi everyone!

Here is my problem..

Department field is a required field into a hidden subform (form1.Page1.REPLACEMENT_SUB).

 

The problem it is when I click the email button it's ask me to fill in

the above field(Department)!

 

I have a DDList with two item (Employee Name,Department).

The Department field becomes available(visible) if I select Department from DDL.

 

Please help!

 

 

 

Here is my variable:

 

 

function Ex1ValidFields()

{

   var bRtn = false;

   var aErrMsg = [];

   var rgEmpty = /^\s*$/;

 

if((form1.Page1.Section_A.EmployeeName.rawValue == null) || rgEmpty.test(form1.Page1.Section_A.EmployeeName.rawValue))

      aErrMsg.push("Employee Name");

     

if(( form1.Page1.REPLACEMENT_SUB.Department.rawValue == null) || rgEmpty.test(form1.Page1.REPLACEMENT_SUB.Department.rawValue))

      aErrMsg.push("Department Name");

     

if(aErrMsg.length == 0)

      bRtn = true;

 

      else

      app.alert("One or more required fields have not been filled out:\n\n   * " + aErrMsg.join("\n   * "),4);;

 

  1. xfa.host.currentPage = 0;

   return bRtn;

   }

 

 

For email button on click event I have the script below:

if(Init.Ex1ValidFields())

 

var myDoc = event.target;    

var address = "aaa@bbb.org";

var sub = "Staffing Req - ";    

var Sender =(form1.Page1.Section_A.EmployeeInfo.Row1.PositionTitle.rawValue);    

var msgBody = "See my Form attached.\n\nThank You!";

  1. myDoc.mailDoc({ bUI: false,        

cTo: address,

cSubject: sub + Sender,        

cMsg: msgBody + "\n\nRegards\n",        

cSubmitAs: "PDF"});

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points