Previous Example-|-Next Example-|-Return to Chapter Listing

Example 17.2:
Getting Information From Prompt Boxes

Now we've collected all that information, we can write it to the document if we wish:


This is the script we used. In the HEAD... <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- var sFname = prompt("What is your first name?","") var sLname = prompt("What is your last name?","") var sAddr = prompt("What is your street address?","") var sCity = prompt("What is your city?","") var sState = prompt("What is your state, province, or region?","") var sZip = prompt("What is your zip or postal code?","") var sCou= prompt("What is your country?","") //--> </SCRIPT> Then this script in the BODY <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- document.write("Let's just check that we got the right information, shall we? Your name is " + sFname + " " + sLname + ". Your address is " + sAddr + ", " + sCity + ", " + sState + ", " + sZip + ", " + sCou + ". Is that all correct?") //--> </SCRIPT>
Previous Example-|-Next Chapter's Examples-|-Return to Chapter Listing