Visual InterDev
You can easily create a form with different modes on your Web page using the FormManager control. For example, you can create a data-entry form with Insert, Update, and Delete modes. When specified control events, such as clicking a button, occur, the form moves from one mode to another.
You can also specify property settings and methods to run both when a particular form mode is established, and during the transitions from mode to mode. All of this is accomplished without scripting, using the FormManager control's property pages.
For detailed examples of how to create a data-entry form using the FormManager control, see Simplifying Data Entry Pages and Data Entry Form Sample. For more information on the FormManager control's property pages, see FormManager Properties Dialog Box.
The first steps in creating a Web page on which you'll use the FormManager control are to add a Recordset control and any other design-time controls you'll want to display on the page in the various form modes. For example, you may want text boxes to display data, and buttons to use to switch between form modes. For information on how to add data-bound controls to ASP or HTML pages, see Querying the Database, Displaying Records, and Viewing Data.
When you have the controls you want to use in your form modes on the page, you can add a FormManager control, and then define its modes and transitions.
Note Although it's common, you don't have to display data on forms created using the FormManager control. If you aren't displaying data on your forms, you don't need to use a Recordset control.
To add a FormManager control to a page
Note If you're using DHTML on your page, be sure to place the FormManager control on the page below any of the controls you want to use with the form. This ensures that the FormManager will have access to all objects on the page.
To add a form mode
For information on how to define the mode, see "To define a mode" below.
To specify a default mode
This mode must be one of the modes you've named and placed in the Form Mode list.
To define a mode
If you're setting a property, the Value field will show <value>. Replace this with the property setting. If the setting is a string, use quotation marks.
If you're running a method, the Value field will show empty parentheses. Put any parameters for the method inside the parentheses. In the drop-down list in the Member field, the methods are listed with their parameters.
For more information on defining form modes, see Simplifying Data Entry Pages. For information on the various script objects for design-time controls and their properties, methods, and events, see Script Objects.
To specify when mode transitions occur
In addition to the methods provided with Microsoft Visual InterDev and the design-time controls' Scripting Object Model, you can also reference methods you've defined in the page's script in a mode or a mode transition. For example, you might want to run a method that validates data after you press a Save button, but before you move to a new mode.
To associate user-defined methods with a mode
Your method will run when the mode is activated, or when the mode transition occurs. If you have more than one user-defined method, the methods will run in the order in which they appear in the table on the property pages.
For an example of a user-defined method on a data-entry form, see the Data Entry Form Sample.