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

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

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.

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

See this post

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

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

Ok, I had not notice this.

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

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

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

Exactly! :slight_smile:

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