Adding an entry to your "Recent Updates" List
So you've created your Recent Updates list, and now you want to be able to add entries via a web based form. Dreamweaver MX makes this really really simple.
First, create a page with a standard form. If you are unfamiliar with this, take a look at the manual or help that came with Dreamweaver MX.
For the example we're using, the Date field and the newsID are automagically filled out by the database, so all we need worry about is adding the text into the newsText field.
This is how my form looks
Note that I've given my text field the same name as the corresponding database field. This isn't something that you have to do, but it does make it a little easier if you do things this way.
I'm now going to go to the Server Behaviors window and use the Insert Record server behavior.
You should be presented with the Insert Record dialog
Make sure you have the correct Connection and Table selected, and that the values are all going to the correct places. Mine was correct by default, as I would expect in such a simple example as this.
Select a URL to redirect to once the record has been inserted. I've selected
my home page - default.asp.
Once you're done, click OK.
Your form should turn blue, indicating that you have a server behavior applied to it.
Try saving your page and opening it up in a browser. You should now be able to add a record to your database.
And the results ...
And there's my entry right at the top of the list. It even has today's date (May 02, 2002). It's also worth noting that because I set my Repeat Region to 3, adding this new entry has pushed one of the older entries off the end of the list - exactly as planned.
You may give yourself another pat on the back!