PDA

View Full Version : Update db record depending on which button pressed. Help?


bobmoo79
10-18-2007, 12:10 PM
Hello,
I am new to Dreamweaver, asp, and all things web.
I am have created an asp page in dreamweaver that connects to a database, which contains a wedding gift list, and displays the image, description, price, vendor etc.
I want to be able to give the site visitors two options – to mark the item as ‘reserved’ and also to mark the item as ‘sold’. I have added a column to the database table called ‘status’ which will hold the status of each item (i.e. ‘reserved’, ‘sold’, or available (no entry in cell)).
I have added two forms to the display table on the asp page, with each one containing a button – one called ‘reserve’ and the other called ‘Buy’.
I have managed to get one of the buttons to act correctly. I added a hidden field to the form, containing the value to be passed to the database, and used the update record server behaviour to update the database. The page redirects to itself, so that the visitor is returned to the giftlist to make more changes if necessary. This works fine for one button. (initially I had a problem because the ‘includes’ statement was listed twice but I removed it)
However, when I try to do the same for the second button (in a separate form on the same page), it doesn’t work. I spent hours last night trying to figure out how to get this to work but I couldn’t do it.
Can anyone here provide any advise on how to do what I want in Dreamweaver? Is there an easy way? Does anyone have any code I can use or edit for my own purposes?

I appreciate any help you guys can give,
Thanks,
Bob.