Easy Online Updates
Once you have a functioning catalog site, you’ll need a way for clients to add new products to your database. Creating an online form to do just that is a snap. Dreamweaver MX provides simple wizards for creating insert pages (to add new records) and update pages (to edit information already in the database).
To make a form for adding a new record to a database, create a new Web page and choose Insert: Application Objects: Record Insertion Form. In the window that appears, select a database connection and the table to which you wish to add a record. After visitors to the page fill out and submit the form, they’re taken to a confirmation page; for instance, “The new product has been added to the database.” Click on the Browse button and select that file from your site.
In the bottom half of the window, select the fields you want to appear in the form. In most cases, you’ll include all of the fields; after all, when someone adds a new product to the database, it should include all information about that product. However, you’ll want to remove any fields the database automatically calculates, such as an autoincrement field used to generate a primary key in the database.
Once you’ve selected a field in the fields box, you can fine-tune its appearance on the form page: type a label that appears next to the form element; select an appropriate form element type — text field, menu, password field, and so on — and choose the type of data (numeric, text, date) to send to the database. Dreamweaver’s smart enough to figure out most of this on its own, so in most cases you’ll just need to change the label to something more user friendly.
After you click on OK, Dreamweaver adds a form to the Web page, along with all of the programming code necessary to add records to the database.
For updating records, turn to the Update Record Form wizard. It works similarly to the Record Insertion Form, but creates a form that’s already filled out with information from a single record.