You are here: Re: how to add delete buttons per subitem in 1 form in an easy way « PHP Programming Language « IT news, forums, messages
Re: how to add delete buttons per subitem in 1 form in an easy way

Posted by Tom on 12/13/06 18:30

On 13 Dec 2006 08:39:05 -0800, 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
>

From my understanding your form will use the "action" and "method" to determine
where it is sending the information and if it's sending the form values in $_GET
or $_POST.

You normally have a single submit button for a form, that follows the action and
method you defined for it. If you have choices to make, you would typically use
check boxes or radio buttons for that. Not sure if you can use multiple submit
buttons on the same form.

If you wanted to limit to one author, maybe try using a radio button with the
same name but different values...

<input type="radio" name="delete_author" value-"100"> Author #1
<input type="radio" name="delete_author" value-"200"> Author #2
<input type="radio" name="delete_author" value-"300"> Author #3
<input type="radio" name="delete_author" value-"400"> Author #4

that way only one can be selected at a time. Then you can use one submit button.

Tom
--
Newsguy.com - Unlimited Accounts $19.95 / 1 mon

 

Navigation:

[Reply to this 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

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