Html coding w/ javascript?

Josh

New member
I am experimenting with html to learn...I was messing with a javascript code but instead of a single pop-up box, there are two. Can someone tell me what is causing this to have two instead of one so that I can fix it.
Thanks for the help!

Here is the code:
<html>
<head>
<script type="text/javascript">
function show_prompt(x)
{
var name=prompt("name","");
var password=prompt("password","");
if (name!=null && name!="")
{
document.write("Hello " + name + "! How are you today?");
}
}
</script>
</head>
<body>

<input type="button" onclick="show_prompt()" value="Sign in" />

</body>
</html>
I understand the extra prompt now thanks...
I dont know why i added the "x" but is there a way to add a second form on the pop-up?
If not then dont worry about it. Thanks for the help anyways :)
 
// Remove this...
var password = prompt("password","");

I was wondering also, why does your show_prompt() function accept a variable 'x'? I don't see the point.
 
Back
Top