prompt Dialog : prompt « Dialogs « JavaScript Tutorial






<html>
<head>
<script language="javascript" type = "text/javascript">
<!--
function verify_password()
{
 var docpwrd = prompt("Specify the password for this document:", "");
 if (docpwrd == "pwrdfile") {
    self.location = docpwrd + ".htm";
 } else {
    alert("That is not the correct password.");
 }
}
//-->
</script>
</head>
<body>
<form>
  <input type="button" value="Open Password Protected File." name="OpenFile" onClick="verify_password()"></p>
</form>
</body>
</html>








13.3.prompt
13.3.1.prompt Dialog
13.3.2.Prompt dialog with default value
13.3.3.Get value from prompt dialog and display it on another dialog