<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="JavaScript">
<!--
function Startup(){
alert("HI")
document.Hi.box.value=prompt("what your name")
Usertwo = document.Hi.box.value;
}
function Change(){
Userone = document.Hi.box.value;
alert("You have been changed to " +Userone)
}
function changeZ(){
if (Userone==Usertwo) {"goodbye" + Userone}else{"goodbye" +Userone + "or" +Usertwo}
}
function compare(){
nickone = document.Hi.box1.value;
nicktwo = document.Hi.box2.value;
if (nickone == nicktwo) {
alert("yes");
}else{
alert("no");
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body onLoad="Startup()" onUnLoad="changeZ()">
<body bgcolor="#999900" text="#003333" link="#006600" vlink="#FFFF00">
<table width="16%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="57%"><a href="week 4.htm">Home</a></td>
<td width="43%"><a href="Untitled-1.htmL">Events</a></td>
<td width="57%"><a href="Untitled-2.html">Programming</a></td>
</tr>
</table>
6. Use the if statement below to say good bye to the user using the onUnLoad
event and a function that check to see if the user has changed the name - if
they have show an alert to say the new name as well as the original name- else
just an alert with goodbye and the original name(to complete this one -you will
need to have a variable to remeber what the first name entered is as well as
one for the new name<br>
7. Add two text boxes to the form, when the second is changed - check to see
if the entry is the same as the first text box - if so show an alert to that
effect - if they are different change the second text box to be the same value
as the first.<br>
8. Add yet another text box to the form and a button as well - now when a number
is entered into the text box and the button is clicked (onClick event), if the
number is not 15 make an prompt come up and ask for another guess - this needs
to keep happening until the correct number is guessed (this will need to be
a while statment)</font>
</p>
<form name="Hi" >
Username
<input type="text" name="box" onChange="Change()"><br>
Compare <input type="text" name="box1" onChange="compare()"><br>
Compare <input type="text" name="box2" onChange="compare()">
</form>
</body>
</html>