Forum Moderators: open

Message Too Old, No Replies

Hidden Fields

         

webmannw

11:01 pm on Mar 22, 2006 (gmt 0)

10+ Year Member



Hi All,

I am trying to pass some values from a html form on one page to some hidden fields in a form on a second page but I cant seem to get it... can anyone help?

Thnaks

Fotiman

3:43 pm on Mar 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Are you trying to populate the hidden fields with JavaScript? You really shouldn't, since someone might visit your page with JavaScript disabled. Instead, whichever page the form submits to should use some server side script to generate the HTML hidden inputs with the values that were passed in. This could be done with PHP, ASP, JSP, Perl/CGI, etc..

However, if for some reason you don't have access to any of those, then you would need to submit the form using the GET method so that the form inputs were passed via the querystring. If your form contains any information that needs to be secure (usernames, passwords, credit card info, etc.), then you definately should NOT be using the GET method. But otherwise, your form would have something like:

<form action="nextpage.htm" method="get">

Then on nextpage.htm, you would need to parse the query string for the form inputs, find the one you were looking for, and assign the value to a hidden input field (or use JavaScript to write out the hidden input field).