You are viewing limited content. For full access, please sign in.

Question

Question

How to copy value of field 1 to field 2?

asked on July 13, 2015 Show version history

We have a process that has 2 forms. Both forms share a field. The field that is shared is filled out when the form is first submitted. At the next user task, the user sees a different form, but with the same field. I need to take the value from that field (field 1) and copy it to another field (field 2).

I have tried adding CSS classes called field1 and field2 to the fields in question and then using the following jQuery to copy the values, but it is not working correctly. Does anyone have any suggestions to what I am doing incorrectly?

$(".field2").val($(".field1").val());

 

0 0

Answer

SELECTED ANSWER
replied on July 13, 2015

Are these just input fields (i.e. single line)? Use something like

$('.field2 input').val($('.field1 input').val());
1 0
replied on July 13, 2015

That did it. Thank you!

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.