Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Passing form field Values from one page to another using Javascript


Message #1 by "Mel C Solomon" <melsolomon@e...> on Sat, 11 Aug 2001 18:53:15 -0800
tnx 4 correction...if noted

-----Original Message-----
From: Maurice Faber [mailto:mrdata@i...]
Sent: maandag 13 augustus 2001 16:50
To: javascript
Subject: [javascript] RE: Passing form field Values from one page to
another using Javascript


It is not needed to add the forms vars to the url you want to go to. If the
forms method is set to 'POST', the vars are automatically appended to the
url...so what yer doing is unnecesary....

anyway, taking a look at yer code....it might be that your url wont open,
cause it ends with a '&'....

======
function funky() {

  var url = "nextPage.html?";
  var i = 0;

  theForm = document.myForm;

  for (i=0; i<theForm.length; i++) {
     url += theForm.elements[i].names + "=" +
theForm.elements[i].value + "&";  //this last '&' f**ks up the url
  }

  theForm.action = url;
  theForm.submit();
}
=========



  Return to Index