Page 1 of 1

post non input variables to next php page

Posted: Thu Jul 24, 2008 11:22 am
by mrkimpton
I guess this is simple but I've been looking for the answer all day.

I want to take some input from an HTML form, then using javascript validate it and then calculate a key that I need to pass on to my next PHP page.

I can see how I pass input fields using <form action="mypage.php" method="post"> but can't figure out how I can also pass data returned from a javascript function. It is imperative that the end user cannot see this data.

Re: post non input variables to next php page

Posted: Thu Jul 24, 2008 9:54 pm
by califdon
Easiest way is to include a hidden input field in your form. <INPUT Type='hidden' ID='something' Name='whatever'>
Populate that input field with your Javascript.

Re: post non input variables to next php page

Posted: Fri Jul 25, 2008 2:59 am
by mrkimpton
It's easy when you know how eh?

Thank you very much.

Mike