dcsimg

Lesson 24: The Script and Its Effect



The Script

<SCRIPT LANGUAGE="JavaScript">
function readitagain()
{
var greeting="Hello "

alert(greeting + document.myform.fname.value + " " + document.myform.lname.value)

alert("length of first name " + document.myform.fname.value.length)

alert("First name in ALL CAPS: " + document.myform.fname.value.toUpperCase())

alert("Full name in all lowercase letters: " + document.myform.fname.value.toLowerCase() + " " + document.myform.lname.value.toLowerCase())

document.myform.receiver.value= ("Thanks " + document.myform.fname.value + ".")


}
</SCRIPT>

<FORM NAME="myform">
What is your First Name?
<INPUT TYPE="text" NAME="fname"><p>
What is your Last Name?
<INPUT TYPE="text" NAME="lname"><p>
<INPUT TYPE="button" VALUE="Submit" onClick="readitagain()"><P>
Look Here after Alert Boxes: <<NPUT TYPE="text" NAME="receiver"><P>

</FORM>

 

The Script's Effect

What is your First Name?

What is your Last Name?

Look Here after Alert Boxes:

 

Back to the Index Page