in reply to Copy data from one form to another?

Assuming, I'm guessing correctly what you want to do, the answer is yes, use JavaScript. Better tell us some more about what you want to accomplish if that answer doesn't suffice.
  • Comment on Re: Copy data from one form to another?

Replies are listed 'Best First'.
Re^2: Copy data from one form to another?
by fmogavero (Monk) on Mar 11, 2005 at 20:16 UTC
    I have some information in one form. Let's say name, address, city, state, zip. We decide to change the city. How do I get that information into another form on the page. This is database driven.
      I'm afraid I still don't have a picture of what you are trying to do. Maybe you mean copying in the page itself. The user types in their ctiy in form #1 and the name automatically gets copied into form #2 ... that can be done with JavaScript. Or maybe you mean that when they submit form #1 the data gets entered in the database and then the user is shown the same page with data from the database filling in form #2. In that case, read the data from the database into CGI.pm params and simply display the forms again using CGI.pm's sticky feature which will place the new values in the forms. But then maybe you mean something other than either of those.
        I suppose it will be Javascript. I had one form which is populated by information from the database. Due to the limitation of one submit button per form I have a second form that has all hidden fields so I could capture the information that I need. I wanted to capture any changes so that the Database could be updated. I would use the param('value') but it gets set on the page load. That means that I would need to capture the information directly from the field so I could transfer it to the second form which has the database updating routine. I hope this explains it.