PDA

View Full Version : change image for active record


choobakka
03-27-2006, 05:26 PM
i have created a recordset which gets 2 records from 1 table within my Access database:

ItemID (primary key, autonumber)
Item_Description

i have created another recordset which gets 3 records from another table within the same database:

InventoryID (autonumber, primay key)
ItemID (foreign key to table above)
Image (image url eg .../images/picture1.jpg)

using the first recordset i have created a drop-down list which displays the Item_Description but references the ItemID.

what i would like to have is once the user has selected the Item_Description from the drop-down list, i would like the corresponding image to be displayed in my webpage.

i am able get the images from the database but it only presents them in what looks like a static webpage.

i would like it to be more dynamic and only present the images that are relevant to the users selection.

how can i do this

davidj
03-28-2006, 09:20 AM
just submit your form using an onChange event on your dropdown

catch the value you pass from the dropdown and use this value to query your 2nd recordset

then just display your image from the 2nd table

choobakka
03-28-2006, 09:37 AM
how can i do this in dreamweaver?

i have created a 2nd recordset which gets the image url and ID from a 2nd table and filtered it with the ID which is the same ID from the first table. then when i place an image from a data source on the page and display the page, i get an error message:

ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted.

davidj
03-28-2006, 10:04 AM
im sorry but asp is not my bag

if you were using PHP i would have written it for you (hint)

choobakka
03-28-2006, 10:12 AM
in my first recordset i have 2 records:

ITEM ID
ITEM_DESCRIPTION

i use this recordset to disaply the ITEM_DESCRIPTION in a list box and set the values equal to ITEM ID

in my second recordset i have 3 records:
ITEM ID (same as above)
INVENTORY ID
IMAGE

in this second recordset i filtered the ITEM ID as equal to the 'form variable' 'select'(which is the name of the select box)

all of this was done in dreamweaver.

is this at least correct?

davidj
03-28-2006, 11:25 AM
yes

are you getting the correct result

choobakka
03-28-2006, 11:58 AM
i am getting the same result.

i have found a way to do it, filtering using another variable but dreamweaver keeps crashing now everytime i try and test it. lol

ahhh. the joys of windows!