Help with Script


hi everyone!

here problem..

department field required field hidden subform (form1.page1.replacement_sub).

 

the problem when click email button it's ask me fill in

the above field(department)!

 

i have ddlist 2 item (employee name,department).

the department field becomes available(visible) if select department ddl.

 

please help!

 

 

 

here 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 have 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 form attached.\n\nthank you!";

  1. mydoc.maildoc({ bui: false,        

cto: address,

csubject: sub + sender,        

cmsg: msgbody + "\n\nregards\n",        

csubmitas: "pdf"});

hi,

 

the script changes presence of replacement_sub subform, should set mandatory property of dropdown. see example here: http://assure.ly/hxhupw.

 

hope helps,

 

niall



More discussions in LiveCycle Designer


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support