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? | [reply] |
The first form is for searching the database. It can search on any of the fields and then return the results. i.e. type in a last name and the fields in the form get populated with the information from the database.I wanted to incorporate a way from that page to modify the data and update the database. The first submit button uses the same form to return search results. The other form would be for updating the database.
| [reply] |
Ok, great, now I understand what you want to do. Here's how I would do it. Forget about Javascript, that wouldn't help here. Don't use two forms, that confuses things (unless there are different fields in the search from and the edit form, in which case, this scenario would need to be modified).
Make one form with two sumbit buttons both with the name "action" and one with a value "search" and the other with the value "edit".
In your script, read param("action") and if it is "search", search the database and then redisplay the same form with the values filled in. If the action is "edit", update the database with the new information and then redisplay the same form again so they can search again. If there is no param("action"), that means the user is just starting so you display the same form, but with blanks.
You only ever have one form, it just has different values filled in or blank depending on context. And you only have one script that does different actions with the database depending on the action param. Does that make sense?
| [reply] |