cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic field creation in adobe forms

Former Member
0 Kudos

Hello Experts,

I had created adobe forms and its working fine, now based on the requirement I am stuck at the point.

The requirement is, based on the data entered in one text field other text field(s) should dynamically get displayed on screen.

More specifically, I am entering data to create material. Based on the data entered in text fields, other text fields should appear dynamically to enter characteristics data.

Please help.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Shubham,

So your requirement is to display certain number of fields depending on the data entered in a text field and hide the same?

For this you have to make use of the scripting language FormCalc Or Javascript . You have to read the data of the text field and depending on your requirement hide / display the fields.

E.g . Here if the text field1 is initial then text field2 will be hidden.

FormCalc :

if (TextField1.rawValue  == null)

then

TextField2.presence = "hidden"

endif.

Hope this info helps.

Regards,

Aravind.P

Former Member
0 Kudos

Hi Aravind,

Thank you very much for replying.

I am trying to create new text field by using following javascript code:

var input = this.createElement("input");

input.type = "Text";

input.name = "text2";

input.caption = "text";

this.appendChild(input);

    But this isn't working.  As I don't have any knowledge of javascript can you please suggest some coding.

Regards,

Shubham

Former Member
0 Kudos

Hi Subham,

Could you give me the exact requirement? Like how many text fields needs to be created and based on what values it should be displayed / hidden and when this should happen?

So is this an interactive form where user enters data? If you could just give me the exact scenario I may be in a better position to help.

Regards,

Aravind.P

Former Member
0 Kudos

Hi,

Yes this is an interactive adobe form.

The requirement is the user has to update characteristic data for the material using adobe forms.

In the text field(MATNR) user enter material number, based on the material number all the characteristics of that material should appear as text fields on the forms.

So, here the number of fields to be displayed is dynamic based on the characteristic values required for that material.

For this we can't declare fields in layout at design time, but based on number of characteristics we have to dynamically create text boxes at run time.

Hope this answers your concerns.

Regards,

Shubham

Former Member
0 Kudos

Hi Subham,

From my knowledge you can repeat an existing field or set of fields by wraping them in a subform but you cannot create a new field from scripting, you could hide or show a field if it is a field you don't have.

Regards,

Aravind.P

Former Member
0 Kudos

Hi,

I had tried the above code.

This code is working at the time of form load or initializing but this code isn't working at run time.

Example: If in my Adobe form I have 3 input fields: fld1 fld2 fld3.

Based on the content entered in fld1 I want to hide fld2.

As this code works but not at real time.

Is there any solution to this.

Please help.

Former Member
0 Kudos

HI Shubham,

Please read my blog. It might be helpful for your case too.

http://scn.sap.com/community/interactive-forms-by-adobe/blog/2012/10/02/action-builder-adobe-forms

Please reward if this help accordingly.

Rgds,

Nitin.