since ‎02-04-2015
‎10-12-2019
hy9fesh
Level 1
Completion status with nested if statements?
Avatar

hy9fesh

hy9fesh
- Adobe LiveCycle
I need something similar to the following script that is not working:In theory, I would put the script in the "calculate" event of a text field called "Completion Status."if(Subform.TextField1.rawValue !== null && Subform.TextField2.rawValue !== null && Subform.TextField3.rawValue !== null &&Subform.TextField4.rawValue !== null &&((TableSubform.Table.Row1.TextField5.rawValue == null && (TableSubform.Table.Row1.TextField6.rawValue == null && (TableSubform.Table.Row1.TextField7.rawValue == null) |...

Views

169

Likes

0

Replies

0
Re: How to calculate a field based on completion of required fields?
Avatar

hy9fesh

hy9fesh
- Adobe LiveCycle
Hi @BR001, it appears that your script works if the mandatory fields are not conditionally changing. I need something more specific. Thanks, though!

Views

108

Likes

0

Replies

0
Re: How to calculate a field based on completion of required fields?
Avatar

hy9fesh

hy9fesh
- Adobe LiveCycle
Here you go @BR001. Thank you so much for looking into this. Note that the Completion Status is set at "Complete" for some reason, even though the required field has not been filled out:form_sample.pdf - DocDroid

Views

110

Likes

0

Replies

0
Re: How to calculate a field based on completion of required fields?
Avatar

hy9fesh

hy9fesh
- Adobe LiveCycle
Give me a few minutes to mock a form up.That said, I've placed the following code into the "calculate" event:if(Form.Subform.execValidate() == false){this.rawValue = "Not Complete"}elsethis.rawValue = "Complete"I want the field to show "Not Complete" or "Complete" based on the whether or not the required fields have been filled. It appears that I can't get this to work unless I put it on a "click" event of a button.

Views

109

Likes

0

Replies

0
Re: How to calculate a field based on completion of required fields?
Avatar

hy9fesh

hy9fesh
- Adobe LiveCycle
Thanks for the suggestion, but that doesn't appear to work either.

Views

108

Likes

0

Replies

0
How to calculate a field based on completion of required fields?
Avatar

hy9fesh

hy9fesh
- Adobe LiveCycle
Is it possible to calculate a field as "Complete" or "Not Complete" based on completion of all the form's required fields?For example, the form is is named "Form" and the subform is named "Subform." I was thinking of coding something in JavaScript, like the following:if(Form.Subform.execValidate == false);{this.rawValue = "Not Complete"}elsethis.rawValue = "Complete"Yet, the above JavaScript doesn't seem to be working?That said, I have a lot of required fields so I'd prefer not to list all of th...

Views

441

Likes

0

Replies

7
How to trigger message box with dropdown selection?
Avatar

hy9fesh

hy9fesh
- Adobe LiveCycle
I am trying to trigger a message box when I select "No" as a dropdown selection using the change event:if(this.rawValue = "No"){xfa.host.messageBox("Please try again.","Error")}However, it is triggered even when I select "Yes." Perhaps it may be due to the fact that the following script is in the "exit" event:if(this.rawValue==null){this.execValidate();}

Views

661

Likes

0

Replies

1
Re: Javascript for 5 or 9 zip code?
Avatar

hy9fesh

hy9fesh
- Adobe LiveCycle
I have the nine-digit pattern set up in LiveCycle (e.g.,12345-1234), so I revised the code a bit and it shows up: if(!/^\d{5}(\d{4})?$/.test(this.rawValue))Thanks!

Views

467

Likes

0

Replies

0
Javascript for 5 or 9 zip code?
Avatar

hy9fesh

hy9fesh
- Adobe LiveCycle
I have a form where I want to do a five to nine zip code; if the user inputs anything else, it is will be deemed invalid and the field will be empty when the user presses "enter."So far, in the change event, I have the following script that only allows 9 digits, meaning the user cannot input more than 9 digits: var maxLength = 9; if(xfa.event.newText.length >maxLength)xfa.event.change = "";Then in the exit event, I have the following script that only allows numerical digits:if(this.rawValue==nul...

Views

1.2K

Likes

0

Replies

3