Livecycle Mandatory Field based on data entry of another Field

Avatar

Avatar
Level 1
UKDragun0v
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile

Avatar
Level 1
UKDragun0v
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile
UKDragun0v
Level 1

10-07-2020

Hello All,

 

I am very new to forms (this is my first post in the community) and found that the company had a license for Acrobat 8 Pro which can with a copy of  Livecycle.  I have used a pdf of a deal sheet and have inserted all the relevant fields, tab orders etc.  I realise that Livecycle is out of date, but i need to show the benefit of forms before they will agree to a license for another product.

 

I would like to make a Numeric field (Aretail) mandatory based on whether another Numeric Field (Apex) contains data.  So if there is no data in Apex field the Aretail field is not required to be mandatory, if  there is data in Apex field the Aretail field is required to be mandatory before allowing the email submit.

 

I have found many scripts on the web and have had a little success with  the following and have written the script in the validate event for the Aretail field (i have no idea if that is correct event to be in but it seems to work to an extent)

 

if  (Apex.rawValue==null)

{

Aretail.mandatory = "disabled";

}

else

{

Aretail.mandatory = "error";

}

 

This has the desired effect except for when I move out of the Aretail numeric field, or try to submit the form via the submit email button, I get the error popup  "Aretail validate failed."

 

Numeric fields have a pattern set to $zzz,zz9.99, the value tab in objects has no validation pattern set, but the error still remains when i set the validation pattern to the same as the numeric field.

 

Any help would be greatly appreciated, as this is the only thing stopping me from releasing the form for use.

 

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Affirm 100
Employee
Kosta_Prokopiu1
Employee

Likes

167 likes

Total Posts

371 posts

Correct reply

107 solutions
Top badges earned
Affirm 100
Validate 1
Establish
Give Back 5
Give Back 3
View profile

Avatar
Affirm 100
Employee
Kosta_Prokopiu1
Employee

Likes

167 likes

Total Posts

371 posts

Correct reply

107 solutions
Top badges earned
Affirm 100
Validate 1
Establish
Give Back 5
Give Back 3
View profile
Kosta_Prokopiu1
Employee

13-07-2020

Hi

forget what you do at the moment and change as follows:

kprokopi_0-1594645514213.png

2 numeric fields APEX and ARETAIL both NOT mandatory and no other validations! When APEX is left empty (rawValue==null) then the retail field can also be left empty. Submit as Email is a good way to submit in Designer Preview.

Change the preSubmit event of ARETAIL ONLY:

kprokopi_1-1594645677092.png

This is how it works:

APEX empty and ARETAIL empty - you can submit (same when ARETAIL is filled)

kprokopi_2-1594645754058.png

APEX filled and ARETAIL not:

kprokopi_3-1594645794052.png

Once you provided a value then Submit goes ahead

kprokopi_4-1594645837117.png

 

Answers (2)

Answers (2)

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,205 likes

Total Posts

6,410 posts

Correct reply

1,147 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,205 likes

Total Posts

6,410 posts

Correct reply

1,147 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

13-07-2020

Moved this question to the relevant topic.

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,462 likes

Total Posts

3,328 posts

Correct reply

949 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,462 likes

Total Posts

3,328 posts

Correct reply

949 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

11-07-2020

Hi,

It seems this question is not related to AEM product. Could you please move/create this question in respective community forum, so that respective experts can have a look.