![]() |
| Advanced SQmlTM Topics |
|
Using a Form to Specify Optional Fields Distributor Catalog Search with Optional Fields: This HTML form gives the user the ability to choose whether or not they want to see certain information in the report. In the SQmlTM file, a cursor queries the table dual which may be used to determine true/false statements. If the field is selected by the user, a value is passed to the SQmlTM file and will make the "where" clause true. This will allow the area surrounded by the cursor to be processed and viewed by the browser. If the field is not selected then the "where" clause will be false and the area inside the cursor will be overlooked. Dynamically Generating Forms Customized Customer Search: This is an example of an HTML form that sends information to a SQmlTM file. The SQmlTM file creates another form according to the request made by the user. Here the dual table is used in the same way it was in the previous example. The data entered in the customized form is then processed by another SQmlTM file which retrieves information from the database. Because of the way I wrote my query in the Sqml file, certain boxes must be checked. Customized Distributor Form: This is another example of SQmlTM allowing users to choose how they want to conduct their search. Note the use of the non-iterative cursor in the SQmlTM file that processes the bottom of the form. By using <sql.block>, we are assuring that only one row will be produced by the cursor. Using SQmlTM in Conjunction with JavaScript: Improved Customer Form: This example uses the same customer form we have seen before. However, now we are using JavaScript to perform calculations with the data retrieved in the cursor. Here, JavaScript is used to calculate the price of the product after it has been discounted. The amount of the discount is determined by the customer's id. Price Increase Form: In this example, a value entered by the user is used directly in the JavaScript. This value is used in the JavaScript to increase the price of the products chosen. The price is not actually changed in the database. The script only changes the value seen by the browser. Item Count: This example shows how to use an SQmlTM cursor inside JavaScript. This is a simple program that counts the number of products that match the users search. |
|
|
|
© copyright 1997 Agave Software Design, Inc. |