Jump to content

Multiple Forms, is this really a problem?


Simmo

Recommended Posts

Hi

 

I have a script that pulls all records out of the database, each record is within a form with no name which results with a lot of forms with essentially the same name.  I have an hidden field with the accID which I use to delete the record.

 

This does what I want it to do but have read that you should avoid having mutliple forms, I guess for validation.  I know I could do this with a link and use GET, but would rather not having this action showing the details of the deletion in the URL.

 

Is multiple forms so bad?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/223596-multiple-forms-is-this-really-a-problem/
Share on other sites

Thanks for reply,

 

I can get the value from that but I want the button to say "Delete", if I put the value there it would just show the number to be deleted which would look strange.  Is that what you meant or have I missunderstood.

 

Thanks

 

Well, I hadn't really thought it through I guess.  :-\

 

You can use an array for the delete buttons where the index is the accID:

 

name="delete[1]" value="Delete"
name="delete[5]" value="Delete"

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.