Java Reference
In-Depth Information
Figure 9.4: Amortization Data
To see how this form is implemented, we will examine its HTML. You can see the form
<input> tag for the “Calculate” button here:
<input type="button" name="action" value="Calculate" onclick="form
Validate(this.form);">
As you can see from the above code, the “Calculate” button calls the formValidate
function when it is clicked. The formValidate function is shown here.
<script type="text/javascript">
<!--
function formValidate(form){
if( form.interest.value.length==0 )
alert("You must enter an interest rate.");
else if( form.principle.value.length==0 )
alert("You must enter a principle.");
else if( form.term.value.length==0 )
alert("You must enter a term.");
else
Search WWH ::




Custom Search