Dreamweaver tutorials
In this chapter I will show you how to create Edit Category page.
Open category_edit.php file located in your admin folder.
Apply template by coing to Modify > Templates > Apply Template to Page. Select admin_temp and click Select button.

In Code view overwrite the line which says:
with the following:
In the Server Behavior tab of the Application panel click + sign and from the list of options choose Recordset (Fig. 175).

In the Recordset window choose:
Name rsCategory
Connection conndb
Table tbl_categories
Columns All
Filter catid > = > URL Parameter > id
Sort None
(Fig. 176)

Click OK and save the file.
In the Code view remove the paragraph which reads <p>Content Placeholder</p> and leave the cursor in its position instead.
Change view back to Design and in the Data tab of the Insert panel choose Record Update Form Wizard (Fig. 177).

In the Recordset Update Form window choose:
Connection conndb
Table to update tbl_categories
Select record from rsCategory
Unique key column catid
After updating, go to category_add.php
In the Form fields section select catid and remove it by clicking - sign.
Select catname and in the Label field overwrite the existing value with Category name:. Leave the rest as default and click OK to add Record Update Form to your page (Fig. 178).

Now let's format our form and table. First place your cursor anywhere inside of the table and click <form#form1> selector (Fig. 179).

On your keyboard press Ctrl+T.
Replace id="form1" with id="forminsert" and press Enter on your keyboard
(Fig. 180).

Now select your table by placing your cursor anywhere inside of the table and clicking the <table> selector (Fig. 181).

In the Properties panel choose:
Table Id tblinsert
CellPad 0
CellSpace 0
Border 0
Align Default
(Fig. 182)

Select Update record button and press Ctrl+T.
Place your cursor after value="Update record" and type id="button".
Press Enter on your keyboard and save the file (Fig. 183).

Now place your cursor in the first cell of the first row and press Ctrl+T on your keyboard twice.
Replace td nowrap="nowrap" align="right" with th and press Enter to apply changes (Fig. 184). Do the same with the cell underneath.

Change view to the Code and identify the line which reads:
Place your cursor at the end of this line and press Enter on your keyboard to create a new line.
On new line type:
Identify the line which reads:
and change it so it reads:
One line down, in the input field, after name="catname" type id="catname" and save the file.
Change the value of the input field from:
to:
Now identify the line which reads:
Create a new line by placing your cursor at the end of this line and pressing Enter on your keyboard.
On newly created line type:
Identify the line which reads:
and after the closing curly bracket place another one so it looks like this:
Now identify the line which reads:
and create a new line.
On new line type the following:
Our validation is done.
Again, we can add the focus on the input field by adding the following after
<!-- InstanceBeginEditable name="head" -->:
Test your file by pressing F12 on your keyboard.
Now let's move to the last chapter of the second part of this tutorial where I will explain how to restrict access to pages by applying one of the Dreamweaver's built in Server Behaviors.
Website Design Company | Website Design Company Sussex | Website Design Company Chichester | Website Design Packages | Tutorials Resources | Articles | Contact
© Web Design Tutorials – Sebastian Sulinski