Forum Moderators: coopster
I'm a little stuck with a script I'm trying to make, to add a TV programme to a database.
There are quite a few fields on the input form, one of which is a 'cast' dropdown box. Next to this is an 'Add' button. The idea is you can select one cast member, click Add; the PHP then remembers that and displays it above the dropdown box. You can then select another and so on, eventually creating a big list above the dropdown. This all works fine.
However, I've also put a Delete button next to already added cast members, which allows you to remove anyone you've mistakenly added.
I'm using a submit button, <input name="deletecast" type="submit" value="ID" />, next to each already added cast member. When pressed, it will submit to the php script: deletecast=ID; ID being the ID of the cast member.
What I'm after, however, is for the button to say "Del" on it rather than the ID number of the cast member, but for it to still submit the ID number to the script.
I can't use an input type=hidden instead, because there will be a list of multiple cast members to be deleted, and all the hidden fields will be submitted, regardless of which delete button is pressed. I've tried using an input type=image, with a picture of an X and a value of ID; this works in Firefox but not in IE. I also want the form to submit all the other fields to the script, so that when the page re-loads it can be re-populated with the existing values already entered. Therefore I don't think I can use a local form tag for each submit button.
I've probably not explained this too well, so ask away if you don't know what I'm getting at. If anyone has any ideas I'd be extremely grateful! Thanks.