PDA

View Full Version : Replace wont work


AName
11-18-2005, 01:10 PM
I'm not sure why, but this refuses to work. I have this script for jscript on asp,var type, name, url, info, fw, info, finfo;
type=Request.Form ("sitetype");
name=Request.Form ("sitename");
url=Request.Form ("siteurl");
info=Request.Form ("siteinfo");
finfo=info.replace("a","b");
fw=type+"||"+name+"||"+url+"||"+finfo;
Response.Write(fw); When I run it, it says that the object isn't supported for the replace line. When I write the line without a var, something like this,finfo="ab".replace("a","b"); I works and writes "bb". I can't find what I'm doing wrong.

Thanks.

DarkStreetDev
11-21-2005, 03:36 PM
Why did you declare the variable "info" twice?

Convert the returned value of Request.Form ("siteinfo"); into a string like so:

info=String(Request.Form ("siteinfo"));

Try that. Should work without giving an error now.