cancel
Showing results for 
Search instead for 
Did you mean: 

field display conditionally

Former Member
0 Kudos

I am having some problem regarding adobe forms , Scenario is:

there is one total field and one nettotal field , nettotal field is addition of total + discounts.

now if the discount is initial the field wil not come in the form and if the discount is not initial the field have to be displayed.....

in smart forms with the help of flag we can apply condition to any field whether we want to display that field conditionally,

how can we achieve this in adobe .????

whether we can do this by alternative ...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

i hve tried that code but it is not working

i hve certain question related to it ??

1. when we made any text field and do binding there are two things which are made , one is text field and second is value field , which one i have to take in the code

2. there are two type of form one is formcalc and second is javascript , which one i wil take .

rite now i am coding like this

if LV_PA_TEXT.rawValue == null 
{
LV_PA_FORM.presence = 'hidden'.

LV_PA_TEXT Is my field name and LV_PA Is my form name

i have taken both the fields in this form and i am making this form invisible when the value is null... and i am putting this code into forcalc ....... it is not working

Former Member

Hi Ankesh,

You can do scripting using either Formcalc or JS. Lets choose JS, then you need to write the code as below:

Traverse the field in the Hierarchy tree starting from the Root (Form Name).

Lets say we have FormName -> SF1 -> SF2 -> Field1

And you want to hide Field 2 for which path is :

FormName -> SF3 -> SF4 -> Field2

then you need to code the script as:

if (FormName.SF1.SF2.Field1.rawValue == null || FormName.SF1.SF2.Field1.rawValue == '')

{

FormName.SF3.SF4.Field2.presence = 'hidden';

Hope this resolves the issue.

Regards,

Arafat

Answers (3)

Answers (3)

Former Member
0 Kudos

if (Field1.rawValue == null || field1.rawValue == '')

{

}

I hve to write field1.rawValue two times , is it ????

Former Member
0 Kudos

Hi Ankesh,

Yes you need to write it 2 times.

Regards,

Arafat

Former Member
0 Kudos

Condition is that if that field is null then that whole field should not be displayed but if that field is not null then that field should be displayed , will you please provide code to me

if <field-name> is (initial or ' ') *what have to come here *
{
ObjectName.presence = "invisible";
ObjectName.relevant = "print";
}

What is the exact code for this.!!!!!

Former Member
0 Kudos

Hi Ankesh,

Use the below code:

if (Field1.rawValue == null || field1.rawValue == '')

{

}

Hope this helps!!

Regards,

Arafat

Former Member
0 Kudos

Hi Ankesh,

You can use the Presence property for setting the visibility of the Discount field in your form based on some conditions as given below:

if (Condition1)

{

ObjectName.presence = "invisible";

ObjectName.relevant = "print";

}

Hope this helps.

Regards,

Arafat