JavaScript carrying value of field from one form to another...

1
0
-1

Hi,

I am populating a form field with JavaScript which is working OK, but when I try to use the field I can't find it/use it.

How do I access the field for use in my second screen?

Scenario:

Process X, Human Step 1, Form 1, one text field Next button Simple button with code

        onclick = "console.log('MyTextGoingIn2');
        var ng0 = 'MyTextFieldGoingOut';
        $('#TextField1').find('.bonita_form_field').val(ng0);"

When clicking the Simple Button this correctly completes the Textfield1 on the screen

  Form 2,
     one text field
     one submit button

When I click the Next button on Form 1 I expect the data in Textfield1 to be available in Textfield on Form 2 but cannot get this to work.

How do I carry the textfield from form 1 to form 2?

I know I could use separate Human Steps but that would be incorrect use of steps, and defeats the objectives of multiple tied forms...

Trouble is there is no way to set a Bonita Variable with the Next Button (Action) which would carry the TextField data...

Many thanks in advance. regards

3 answers

1
+1
-1
This one is the BEST answer!

It seems the only way to do this is by using REST (in the Community version that is...)

See this post

1
0
-1

You can use a REST API call via jQuery.ajax() method.
Javascript obfuscator

1
-1
-1

Hi, To carry a data between two forms, you need to create a task variable and when you click on the "Next" button, you set the value of this task variable with the value of the TextField (in the Actions tab). Then, in the second form, you set the initial value of your second field with the task variable.

Comments

Submitted by Sean McP on Tue, 04/07/2015 - 09:15

Hi Yannick, there is no Action tab for a Next button.

Submitted by yannick.lombardi on Tue, 04/07/2015 - 09:18

Ok, I had not notice this.

Can't you use the Output operation of your text field to set the variable ?

Submitted by Sean McP on Tue, 04/07/2015 - 09:25

Output does not work until the submit button is pressed as far as I can tell.

Submitted by yannick.lombardi on Tue, 04/07/2015 - 09:28

Exact. I don't see what to do in this situation.

Submitted by Sean McP on Tue, 04/07/2015 - 09:34

Exactly! :)

I'm playing around with this post by Domenico which I'm modifying for my specific situation.

It uses REST...any other solutions gratefully received.

regards

Notifications