Validating a purchase form with java script
One of these handy scripts is found in the Add Item button's click event (Figure 4.1).
The base price is used to ensure that users do not enter lesser values and to prevent the price inflation by more than 5%.You have already learned a lot about these property settings in previous chapters, and you will learn more in Chapter 5, "Form Data." But this chapter focuses on setting and getting these property values at runtime through scripting.Scripting gives you full control over your form's functionality at runtime.You can see this in action by opening the Purchase Order form from the Samples folder (it can also be found in Designer's Help System).
A number of useful scripts are included in this form.If the product has just been saved, then the script will reset values of fields The script figures the minimum and maximum price that can be entered by the user.