


I have this error:
TypeError: s.replace is not a function
68:Doc:Init
This is the code that generates the error:
function EL(s)
{
var sir = "";
sir = s.replace(/[&]/g,"&"); <<<---------------------- this is the error line
sir = sir.replace(/["]/g,""");
sir = sir.replace(/[“]/g,""");
sir = sir.replace(/[”]/g,""");
sir = sir.replace(/[']/g,"'");
return sir;
}
I am a newbie in javascript and adobe livecycle designer...what is causing the error ? What should i do
Views
Replies
Sign in to like this content
Total Likes
Hi there,
everything seems syntactically correct, so I would say make sure that the parameter 's' is a string...
Hope this will help
Hi there,
everything seems syntactically correct, so I would say make sure that the parameter 's' is a string...
Hope this will help
Please try updating script to below:
var sir = "";
sir=this.rawValue;
sir = sir.replace(/[&]/g,"&");
sir = sir.replace(/["]/g,""");
sir = sir.replace(/[“]/g,""");
sir = sir.replace(/[”]/g,""");
sir = sir.replace(/[']/g,"'");
Thanks,
Mayank
Views
Replies
Sign in to like this content
Total Likes
This seem to be working fine for me...
ensure that this.rawValue is in fact returning the value desired...
use app.alert(this.rawValue);
Views
Replies
Sign in to like this content
Total Likes
I have updated the script that was posted in the question originally, mine is working one
Views
Replies
Sign in to like this content
Total Likes
Hi,
I think Magus069 is correct, s will either be null or some other object that doesn't have a replace method, such as a number.
Bruce
Views
Replies
Sign in to like this content
Total Likes
Thanks i solved it, i have to call the .toString() method on the variable
Views
Replies
Sign in to like this content
Total Likes