Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Make one field trigger another

Avatar

Former Community Member

I am really new to LiveCycle Designer and am having some difficulty with a form I am working on.  I am currently trying to convert a form I created in Adobe Professional to a LiveCycle Designer form.  In Adobe Professional, I had some JavaScript that after a field stating billing terms was filled in, the corresponding field for delivery terms was marked.  Thus preventing the salesperson from entering delivery terms that did not correspond with the billing terms.  I am trying to re-create this in LiveCycle and am not having any luck.  I tried entering this if statement, but received an error message:  if (this.rawValue != " " &&  this.rawValue!= is null) then this.getField("OrderType").value = "DandI" endif;  What am I doing wrong?  How can I get this to work?

6 Replies

Avatar

Former Community Member

You are mixing object models .....the code that you write in Designer woudl be based on the XFA object model and most of your code follows the right format...but you also have references to AcroForm objects (this.getField(OrderType).value)....this woudl be wriiten using the xfa model as OrderType.rawValue = "Dandl"

You shoudl be getting errors when you execute the script ...in your case I assume that you have the script language set to FormCalc. I prefer to use Javascript and in that way you get better error message collection and reporting in the javascript console in Acrobat.

Make sense?

paul

Avatar

Former Community Member

Yes, that does make sense.  I modified what I had to show:

if

(this.rawValue != " " && this.rawValue!= is null) then (OrderType.rawValue = "DandI") endif

However, I am still getting an error message.  I am using JavaScript as the script language.  The error message states "Error:Expected : ), Line: 5.  What does it mean?  Where do I need parenthesis?

Avatar

Former Community Member

If you are using javascript then your syntax is all wrong:

if ((this.rawValue != " ") && (this.rawValue!= is null)){

     OrderType.rawValue = "DandI"

}

Avatar

Former Community Member

I copied the code you provided, but I am still getting that same error message.

Avatar

Level 10

Change:

if ((this.rawValue != " ") && (this.rawValue != is null)){

     OrderType.rawValue = "DandI"

}

To:

if ((this.rawValue != " ") && (this.rawValue != null)){

     OrderType.rawValue = "DandI"

}