|
Posted by Tony Marston on 12/15/06 09:06
Instead of having a separate delete button against each line why don't you
have a checkbox against each line and a single delete button for the whole
screen? That way you can select multiple lines before pressing the delete
button. This technique means you can also have a single update button so
that you can select multiple lines to be updated.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
"bill" <nobody@spamcop.net> wrote in message
news:kuOdnel9If6VrhzYnZ2dnUVZ_v2nnZ2d@cablespeedmi.com...
> 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>
> <button type="submit" name="disposition" value="disapprove">
> Disapprove and return to data entry page. </button>
> <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
Navigation:
[Reply to this message]
|