Get another variable

So, I have this script, and it feeds a bunch of variables to the next form.  But due to how the form is layed out, and for a viewer's perspective, we don't ask one variable.  So when the user clicks submit, I route them to another page, and ask them that one question.  Is there a way to do this via javascript or something, so when they click submit, I would pop up the window and get that last variable??

And if so, any way to do any checking (i.e. I'd be looking for a number, so if they put in text, I could just reassert the window or something?)

Thank you.
LVL 1
dougp23Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

star_trekCommented:
You can hidden variables which stores users responses with a particular seperator and based on this values in the next page you can do some maipulation.
0
BogoJokerCommented:
Hi dougp23,

You can do something like this in javascript, and I will show you an example, but I suggest that you find another way to do this without javascript because javascript is client-side and it can be compleetely disabled by the user.  PHP or ASP, are server-side scripts that will run 100% of the time.  Still, PHP cannot make a popup, so in the end that final question should be attached to that form or something convient, for now here is a javascript example:

<html>
<head>
<script type="text/javascript">
function askQuestion()
{
  var input = prompt("Are you scared!? Answer on a 0-10 scale!");
  if (isNaN(input) || input < 0 || input > 10)
  {
    alert("Must be a Number from 1-10!");
    return false;
  }
  document.getElementById("hide").value = input;
  return true;
}
</script>
</head>

<body>
<h3>Here is a makeshift form, you don't need to do anything but push the submit button!</h3>
<form>
Name: <input type="text" name="NAME">
<input type="hidden" name="HIDDEN" id="hide">
<input type="submit" value="submit" onclick="return askQuestion();">
</form>
</body>
</html>

Test it out, it just has a javascript prompt() that asked for a number for 0 to 10 =)
Joe P
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.