cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Scripting in interactive Form

Former Member
0 Kudos

hi everyone,

Can any body send tutorials on how to use scriptng in interactive form.

Actually i have a requirement ,to make a text field visible based on the value that i

enter in other text field

I am beginner and cannot able to achieve it,

Please send any examples or how to approach it

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

harman_shahi
Contributor
0 Kudos

Hi Madhavi,

There are few good scripting tutorials located at the following location:

http://www.adobe.com/devnet/livecycle/designer_scripting_samples.html

Simply put, this is how you would place scripting for your purpose:

1) Open your form in Adobe LiveCycle Designer.

2) Select the "text field" that should trigger the event.

3) Then Select "change" event from the "Show" dropdown box (located on top, just below the file menu)

4) Write your JavaScript here.

Hope this helps.

Regards,

Harman

Former Member
0 Kudos

Hi check the follwoing link to get more info about script

<a href="/people/juergen.hauser2/blog/2007/05/30/useful-documentation-for-developing-interactive-forms:///people/juergen.hauser2/blog/2007/05/30/useful-documentation-for-developing-interactive-forms

sample code as follows

second text2 field on load event ,write the following code

if(data.text1.rawValue=="CAR")

then

this.access = "readonly"

this.presence = "visible"

else

this.presence = "invisible"

this.access = " "

endif

Former Member
0 Kudos

Hi,

I could not able to find on load event for a text field.

I have written javascript code in on change and even tried with on enter Events ,

But its not working ,

Will u please help me further

Thanks in advance

harman_shahi
Contributor
0 Kudos

first, just for troubleshooting purposes, try to place some alert messages to make sure the javascript event is actually getting triggered:

xfa.host.messageBox("Textfield is changed…", "Warning", 3);

regards,

h

Former Member
0 Kudos

hi,

When i have written xfa.host.messageBox("Textfield is changed…", "Warning", 3); in the change event of the text field and trying to enter data into it i am getting displayed with a warning message(a alert message box).

But i could not understand why the other text field is not getting invisible.

I am sending the code which i have written in the chage event of text field2.

in form ready event of textfield2 i have initialized the raw valu as hai

if(subform3.TextField2.rawValue == "hai")

{

subform3.TextField4.presence = "visible";

}

else

{

subform3.TextField4.presence = "hidden";

}

xfa.host.messageBox("TextField is changed","warning",3);

Please tell where i am doing mistake

Thanks in advance

Former Member
0 Kudos

The first string corresponds to the message header andd the second one to the text message.

Kindly check the syntax in the adobe designer help.

Thanks and Regards.

Anto.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi madhavi kotra ,

Scripting

Adobe LiveCycle Designer uses the script languages JavaScript and FormCalc. FormCalc is a simple Adobe script language for typical form calculations, including mathematical and logical functions, and date and character string functions. For more information about FormCalc, and a FormCalc language reference, see the online help of Adobe LiveCycle Designer.

To achieve the best possible performance when processing forms, use as little scripting as possible in the form itself. If possible, perform all calculations and data analysis in the application program, before the form is called

The following websites provide details on scripting:

Improving the Performance of Adobe® LiveCycle™ Designer Forms(scripting)

http://www.adobe.com/devnet/livecycle/articles/lc_designer_perf_guidelines.pdf

SAP® Interactive Forms by Adobe® Development Introduction

http://www.nl4b.com/Adobe/Invitation_SAPBrussels_Q407.pdf

cheers!

gyanaraj

****Pls reward points if u find this helpful

Former Member
0 Kudos

Hi madhavi,

Please click on the other fiedl and go to FORm calc and write the below code in change event

if $.rawvalue <> " " then

textfield.presence = "VISIBLE"

endif