faqts : Computers : Programming : Languages : JavaScript : Forms

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

17 of 35 people (49%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

how do I pass a value from one page to another using hidden form fields?

Aug 28th, 2000 06:27
Martin Honnen, bill myers,


If you only use client side processing you need to use
  <FORM METHOD="get"
to pass data in the query string of the url. Then use the code provided 
in http://www.faqts.com/knowledge-base/view.phtml/aid/969/fid/129/lang/
to read the passed variables and write out new hidden form fields for 
them:
  var args = parseQueryString ();
  for (var arg in args) {
    document.write('<INPUT TYPE="hidden" NAME="' + arg + 
                    '" VALUE="' + args[arg] + '">');
  }