Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Copy data from one form to another?

by fmogavero (Monk)
on Mar 11, 2005 at 20:16 UTC ( [id://438791]=note: print w/replies, xml ) Need Help??


in reply to Re: Copy data from one form to another?
in thread Copy data from one form to another?

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.
  • Comment on Re^2: Copy data from one form to another?

Replies are listed 'Best First'.
Re^3: Copy data from one form to another?
by jZed (Prior) on Mar 11, 2005 at 20:23 UTC
    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.
        I'm not sure what you mean by limitation of one submit buttom, forms can have any number of submit buttons and if they have different names or values, you can tell which was clicked when you get the form in a script. But here's where you've lost me again - why are there two forms? and what is the intended destination/result of submitting them?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://438791]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-19 04:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found