Reply to Re: how to add delete buttons per subitem in 1 form in an easy way

Your name:

Reply:


Posted by bill on 12/14/06 11:18

wim taerwe wrote:
> Hello,
>
> I am looking for an easy way to have a delete button per subitem in 1
> form.
>
> For example : a book can have many authors and when I edit the book
> details I want to have a list of the authors each with a separate
> delete-submitbutton next to it. Now I have the problem that I cannot
> know which exact author I want to delete when I click the delete button
> next to it.
>
> I could name every delete button differently like
> "delete_author1","delete_author2",... but what is the easiest way to
> process this after the submit.
>
> Thanks in advance for your reactions,
>
> Wim Taerwe
>
If you want you can have multiple submit buttons, each indicating
a different author to delete.

eg: (copied from a form that has multiple submit buttons to
indicate disposition of the displayed provisional web page,
generated by php)
--------------------------------------
<form method="post" action="approve_or_not.php" >
// put page id in a hidden element
<input type="hidden" name="kennel_id "
value="<?php echo $_POST[kennel_id] ?>" />

<button type="submit" name="disposition" value="approve">
Approve and make this page active. </button> &nbsp;
<button type="submit" name="disposition" value="disapprove">
Disapprove and return to data entry page. </button> &nbsp;
<button type="submit" name="disposition" value="quit">
Save data and just quit. </button>
</form>
---------------------------------------------------------
This will generate 3 buttons with the same name but different
values and captions.

In the receiving page I just look at the value of
$_POST[disposition] to take the appropriate action.

bill

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация