<html>
<head>
<script language="vbscript">
sub GetUserName()
dim firstName
dim lastName
firstName=inputbox("Please type your first name")
lastName=inputbox("Please type your last name")
msgbox("Your full name is: "&firstName&" "&lastName)
end sub
</script>
</head>
<body>
<form>
<input type="button" value="Click" onclick="call GetUserName()">
</form>
</body>
</html>
| We saw the variables and input box before. Msgbox display message window and writes on anything whithin the brackets. Onclick() is an event executed when the button is clicked and in this case it calls GetUserName sub procedure. When GetUserName is called, all the statements in it is evaluated and executed.
|