In this section of the tutorial, you will learn how to configure the newly created insert page (insertcomcon), so that you can decide if you want to add more contacts after the submit or not.
To accomplish this, you will need a way for the user to pass his decision (a menu, radio-button, checkbox), and a way to redirect The redirect server behavior A server behavior is a reusable component for server-side development. They add blocks of code to your pages for accomplishing specific tasks. Dreamweaver comes with several default server behaviors and the InterAKT extensions add many more to this list. loads a new site page after a transaction A transaction is a group of SQL statements whose effects are logically connected. Anything from simple queries to inserting, and deleting operations can be considered a transaction, as well as more complex groups of several statements which accomplish a specific task. is executed. For instance, users could be automatically redirected to their inbox after they log in to the website. to a specific page based on a condition. As for the passing the decision part, there is no problem, only the choice of the HTML form elements remains. For the conditional redirect action, however, you would have some hand-coding to do.
MX Kollection 3 has this need covered too, however, through the Redirect To Page trigger A trigger is a SQL procedure that performs an action when a transaction (INSERT, UPDATE, DELETE) occurs. You can use triggers to perform validation of input data, to automatically generate a value for a newly inserted row, to read from other tables for cross-referencing purposes, or to support alerts through e-mail messages.. As all the other MX Kollection 3 triggers, this one can be turned into a conditional trigger, simply by using the expression builder on the advanced tab.
To add this functionality, you will have to alter the design of the insert page (e.g. insertcomcon), and only then add the application logic that performs the actual task.
This alteration concerns adding a new form element, so that the user option of whether to add some more contacts or not can be passed to the trigger. The simplest of elements that can be used effectively is a checkbox. To change the design, follow the next steps:
The actual operation will be based on the Redirect To Page trigger, which will be set to start on a custom condition: that the Add more contacts checkbox is checked.
To add and configure the redirect trigger, follow the instructions below:
When you add a company through this insert form, if the Add more contacts checkbox is checked, when submitting the page, you will be taken to the contact insert page, where you can continue adding entries:
In the next topic of the tutorial you will create a page that will automatically send birthday greetings to your contacts.