Adding a new record
We have seen the update function work. But, we have not seen the working of our insert function yet. We will modify the code so that we can add a new record. We will have to modify the content section of the product_list.cfm
page to complete this function. The previous page is already set up to run:
<!--- Content ---> <cfif url.message NEQ ""> <div> <cfoutput>#url.message#</cfoutput> <hr /> </div> </cfif> <h3>Select a product to edit.</h3> <ul> <li> <a href="product_edit.cfm">+ New Product </li> <cfoutput query="rsProducts"> <li> <a href="product_edit.cfm?id=#rsProducts.id#">#rsProducts.name# </li> </cfoutput> </ul>
Now, let us observe the page again. Once the page is loaded, and we click on refresh, we will see the following page:
Let us click the + New Product link, and observe what we get. We receive a new form to...