|
|
|
|
|
- Overview
- Principle
- Implementation
- Example
Validating a page from a control that has no action on the server (List Box control, Combo Box, etc.)
By default, the validation of a page must be performed by a "Send the values of controls to the server (submit)" button. To validate a page when selecting an element in a List Box, Combo Box, Check Box or Radio Button control, use PageSubmit. PageSubmit is used to validate a page via a visible or hidden button whose server click code is run. The following events are run when PageSubmit is called: - Sending the data to the server.
- Server click code of button.
To validate a page from a control without action (List Box, Combo Box, Check Box control, etc.): - Create a new button in the page: this dynamic button can have any type, it can be visible or not. This button is used to start the validation of the page. Only the server click code of this button will be run.
- In the modification code of the control without action, use PageSubmit and specify:
- the page to validate if necessary.
- the name of the button used for the validation (created in step 1).
- the frame containing the result of the button action (for a frameset for example).
Selecting an element in the List Box control named LIST_CONTINENT is used to display the selected element in a dialog box. The code of the List Box control is as follows: // -- Initialization of LIST_CONTINENT ListAdd(LIST_CONTINENT, "Africa" + CR + "America" + CR + "Asia" + CR + "Europe" + CR + ... "Oceania") Â // -- Modification and exit (onchange) from LIST_CONTINENT // Validates the page and starts running the server click code of BTN_Button1 PageSubmit("", BTN_Button1)
Code of BTN_Button1: // -- Click on BTN_Bouton1 (server code) Info("Selection: " + LIST_CONTINENT[LIST_CONTINENT])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|