homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

Passing Values or Content using Params
Using Javascript

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

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)

take out the "unescape" from the processing script.


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

Actually heres what I found to work:

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


~Isaac Lloyd~

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved