HTML and CSS Reference
In-Depth Information
mortgage calculator
form on Web page
Figure 10-14
Validating Forms Using Nested if...else Statements
You can use different techniques to validate forms. This chapter uses a series of
nested if…else statements. The if…else statement is like the if statement except that
it specifies statements to execute if the condition is false, as shown in the flowchart in
Figure 10-15. Much like the if statement, an if…else statement tests a condition. If
the condition is true, the statements between the curly braces after the if statement
execute. If the condition is false, the statements between the braces after the else
statement execute.
if and if…else
Statements
JavaScript if and if…else
statements are an integral
part of the programming
language. These
statements control the
flow of logic or execution
of expressions based on the
result of a conditional test.
statements
executed if
condition is False
statements
executed if
condition is True
Figure 10-15
 
Search WWH ::




Custom Search