Jump to content

Multiple Prompt Boxes


Newkirk

Recommended Posts

How would I set up multiple prompt boxes other than just one like:

<html><head><script type="text/javascript">function disp_prompt(){var name=prompt("Please enter your name","")if (name!=null && name!=""){document.write("Hello " + name + "! How are you today?")}}</script></head><body><form><input type="button" onclick="disp_prompt()" value="Display a prompt box"></form></body></html>

Link to comment
Share on other sites

Is this the thing you want??

<html>	<head>		<script type="text/javascript">			function disp_prompt()			{				var name=prompt("Please enter your name","")				var Age=prompt("Please enter your Age","")				if (name!=null && name!="")				{					if (Age != null && Age != "")					{						document.write("Hello " + name + "! Your age is "+ Age);					}									}			}		</script>	</head>	<body>		<form>			<input type="button" onclick="disp_prompt()" value="Display a prompt box">		</form>	</body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...