Expand my Community achievements bar.

Duplicating information by pressing a button?

Avatar

Former Community Member
I am trying to make a button that will duplicate the information from a few text boxes to a different text box, they will not always be the same, but I want the person to be able to duplicate all the info if it is needed. I see javascript/FormCalc code can be used, I just lack the knowledge on how to transfer the information from one part to another.



All my little text boxes are labeled like this..

FSN1

PartNo1

ItemD1

Serial1



Then it goes FSN2, PartNo2...ect...



I basically want to have it so when I push button1, whatever text is in FSN1 goes into FSN2.



Any ideas guys?
2 Replies

Avatar

Former Community Member
You can do this with some simple FormCalc script by selecting button1 and editing it's Click event in the Script Editor palette. Here's the script you could use:



FSN2 = FSN1

PartNo2 = PartNo1

ItemD2 = ItemD1

Serial2 = Serial1


I'm wondering how your form is setup, however, because this seems like a case where you would want to be using dynamic subforms where each item would be a subform (each containing the four text fields described in your post). You could then setup your forms such that on the click of a button, a new item is added to the form (which could easily be pre-populated with the information entered in the last item). If this sounds like it applies to your form, I'll be happy to go into more detail.



Stefan

Adobe Systems

Avatar

Former Community Member
I hava a similar problem, but I need to replicate those fields more than once.

In this example If try to put another field with the same name (pe. FSN2), the data doesn´t appear like in the first FSN2. What I am doing wrong?