Copy link to clipboard
Copied
I'm trying to create a honeymoon registry for a travel client of mine and I'm confused on how to do it.
Here's how I would like it to work:
I would have the list of items on the page with a checkbox next to each one for purchase. When that box is checked it would update the "purchased" field in the database and also be submitted in the form. When one of the items is purchased I want it to say "Purchased" so the next person knows it's not available.
The item would be submitted to the travel company with Credit card information, it would not be processed on the site.
Now, here's what I have thought out:
I had thought about just setting up a shopping cart but since they don't want the usual "checkout" I figured I would scrap that idea.
Instead, I would have to do it from scratch. I would create a database with three fields: item, price and purchased (yes or no)
I define my database and create a recordset. I insert the fields from the bindings tab. I create a checkbox for the purchased item.
I installed the Advanced Conditional Region extension to get the items to show as "purchased".
Now, I'm not sure if I'm doing this correctly. Do I need to do the recordset and bindings? If I repeated the region and had all of the items listed, how would the checkbox work for each item?
It seems like it would be so simple but I can't seem to wrap my brain around it!
TIA!
Dawn
Copy link to clipboard
Copied
So taking this one step at a time, how much of it have you got it to work so far? Are you able to update the database with the purchased indicator?
Copy link to clipboard
Copied
Not working yet. The update record isn't working.
I'm still trying to figure out how to set up the database.
I have two. One with item, price and purchased. The other I have a column for each item purchased -- yes/no selection.
Copy link to clipboard
Copied
Are you using MSSQL or Access? Have you established a connection to the database via dreamweaver? Please provide all this background info on what you did and whether it works to help solve your issue.
Copy link to clipboard
Copied
I am using Access.
Yes, I have connected to the database.
I've created a Recordset.
I selected each checkbox and selected the fields in Bindings.
When I try to create the Update Record I have an issue. the Unique Key I'm selecting isn't being accepted. I am choosing the primary key field but it doesn't want to work. Choosing another field doesn't work.
I have updated records before and have never had this much difficulty. I'm thinking that I don't have the database set up correctly. ??
Thanks for the help!!
Copy link to clipboard
Copied
Are the bindings working when the page loads?
So it sounds like DW isn't allowing you to complete the Update Record servier behavior? What is the wording of the error message?
What are you using for primary key in Access - is it a numeric field?
(Do you have a link to the page? I'm not familiar with the extension, but if you're displaying the items dynamically using a repeat region, then the Update behavior will not update multiple records. I don't know if that's the cause of the error message or not)
Copy link to clipboard
Copied
The bindings are working. It's just when I get to the Update Record, that's where I have the problem.
The primary key in access is an autonumber field - ID. If I change the primary key field it still doesn't work.
Here's the box that pops up: Please choose a unique key from the selected Recordset, or click Cancel.
No matter what field I choose, it doesn't accept it.
I'm not displaying the information dynamically. Just the checkbox is dynamic so that it updates to the database.
Here's the page link: http://ads.butlereagle.com/Test/SRT_registry.asp
Thanks so much for the help! I appreciate it.
Dawn
Copy link to clipboard
Copied
Did a quick search - seems the main cause of this error is when you didn't include the ID field as part of the initial recordset. Could that be the case?
Copy link to clipboard
Copied
Yes, that was it! I forgot to put ID in the recordset.
I tried doing the update record again but have another error. It's in the javascript file EditOperations.js.
TypeError:checkboxesHash
I Googled it and I may need to clean out the cache?
Copy link to clipboard
Copied
Search the Adobe help docs using the specific error message, I think this is a fairly common issue.