qualitymove13
MIS
I was looking for some clarification. While i get my prompt to come up as i'd like, I cant seem to get two desired effects correct.
1. Id like the only allowable entry into the prompt to be a number else id like it to display the error prompt (this actually comes up regardless of entry now).
2. Id also like the desired result to be any allowed number that is entered not just the 5 I have listed.
Any help is appreciated and thank you in advance.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"<html xmlns=" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript">
/*
The code below allow user to enter a number
then the number will display in reverse order
*/
function show_prompt()
{
var number=prompt("Enter number to reverse");
if (number!=null && name!="")
{
document.write("Here is your number in reverse order " + number);
}
else
{
alert("is not a number");
}
var rNumbers = ["1", "2", "3", "4", "5"];
document.write(rNumbers.reverse());
}
</script>
</head>
<body>
<input type="button" onclick="show_prompt()" value="Enter A Number" />
</body>
</html>
1. Id like the only allowable entry into the prompt to be a number else id like it to display the error prompt (this actually comes up regardless of entry now).
2. Id also like the desired result to be any allowed number that is entered not just the 5 I have listed.
Any help is appreciated and thank you in advance.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"<html xmlns=" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript">
/*
The code below allow user to enter a number
then the number will display in reverse order
*/
function show_prompt()
{
var number=prompt("Enter number to reverse");
if (number!=null && name!="")
{
document.write("Here is your number in reverse order " + number);
}
else
{
alert("is not a number");
}
var rNumbers = ["1", "2", "3", "4", "5"];
document.write(rNumbers.reverse());
}
</script>
</head>
<body>
<input type="button" onclick="show_prompt()" value="Enter A Number" />
</body>
</html>