
Skype: beeworkweb
Email:info@beework.net
Sales (free):
0800 882 4173
Support:
0870 978 0583
Mobile:
07866 627185
Registered Member
of the UK Web Design
Association
Generates JavaScript if then code. Just Click the button to see the If Then Syntax.
if (condition) {
statements1
[ } else {
statements2 ]
}The condition can be any JavaScript expression that evaluates to true or false. The statements to be executed can be any JavaScript statements, including further nested if statements. If you want to use more than one statement after an if or else statement, you must enclose the statements in curly braces, {}. Example. In the following example, the function checkData returns true if the number of characters in a Text object is three; otherwise, it displays an alert and returns false.
function checkData () {
if (document.form1.threeChar.value.length == 3) {
return true
} else {
alert("Enter exactly three characters. " +
document.form1.threeChar.value + " is not valid.")
return false
}
}