Wrox Home  
Search P2P Archive for: Go

  Return to Index  

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


Message #1 by =?iso-8859-1?Q?Hans_J=F6rg_Friedrich?= <hans.friedrich@b...> on Mon, 13 Aug 2001 16:55:21 +0200
Hello Maurice

Form values are coded in the URL if the method is 'GET'

Hans

-----Urspr=FCngliche Nachricht-----
Von: Maurice Faber [mailto:mrdata@i...]
Gesendet: Montag, 13. August 2001 16:50
An: javascript
Betreff: [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 '&'....

=3D=3D=3D=3D=3D=3D
function funky() {

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

  theForm =3D document.myForm;

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

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



  Return to Index