Welcome to WebmasterWorld Guest from

Forum Moderators: brotherhood of lan & mack

Message Too Old, No Replies

Passing Values or Content using Params

Using Javascript



6:06 pm on Mar 21, 2005 (gmt 0)

10+ Year Member

Here is the script:

<!-- Begin
function getParams() {
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx!= -1) {
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
for (var i=0; i<pairs.length; i++) {
nameVal = pairs[i].split('=');
params[nameVal[0]] = nameVal[1];
return params;
params = getParams();
// End -->

Heres the address it uses when the form is submitted:

[example.com...] etc....

Heres the Problem:

name = unescape(params["name"]);
address = unescape(params["address"]);

Name = new+guy
Address = 1002+road

I need the output to be:

Name = new guy
Address = 1002 road

so it needs to change the "+" for a "space". Any help or comments is greatly apreciated.

~Isaac Lloyd~


7:02 pm on Mar 21, 2005 (gmt 0)

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member

take out the "unescape" from the processing script.


2:50 am on Mar 22, 2005 (gmt 0)

10+ Year Member

Actually heres what I found to work:

name = unescape(params["name"]);
var regEx = /\+/gi;
name = name.replace(regEx," ");


~Isaac Lloyd~


Featured Threads

Hot Threads This Week

Hot Threads This Month