Databases Reference
In-Depth Information
Listing 3-7. Validation JavaScript
<script type="text/javascript">
function validSalary(object){
if(parseInt(object.value)>5000)
alert('Salary must be a figure below $5000');
}
</script>
Figure 3-8. Specifying the validSalary JavaScript function
5.
After doing this, navigate to the Page Definition area of your form again. Right
click on the P1_SALARY form item under Salaries Regions Body (3)
Salaries Items menu in the Page Rendering section. Click the Edit item in the
pop-up menu.
6.
Navigate to the Element tab, and type the code shown in Listing 3-8 in the
HTML Form Element Attributes field (as shown in Figure 3-9).
Listing 3-8. Adding a JavaScript Event Handler to the Salary Field
onblur="validSalary(this);"
 
Search WWH ::




Custom Search