K
kookie
I have a field I am using in the naming convention of the file. I need to
remove special characters because WSS does not support them. I can throw an
alert but I can not get it to replace the regular expression with a blank or
"". here is my code:
<code>
function removeRE1() {
var re1 = new RegExp("[\!\@\#\$\%\^\&\*\(\)\_\+\=\{\}\?\<\>\'\;]");
// Get the field value
var strMnPName =
XDocument.DOM.selectSingleNode("/my:myFields/my:MnPName").text;
// Find a match within string s
try {
if (re1.exec(strMnPName) != null){ // && eventObj.Operation == "Insert") {
XDocument.UI.Alert("Please remove any Special Characters!\n ! @ # $
% ^ & * ( ) _ + = { } ? > < ' ;");
strMnPName = strMnPName.replace(re1.exec(strMnPName),"");
}
}
catch (e) {
throw e;
}
}
</code>
Please help!
remove special characters because WSS does not support them. I can throw an
alert but I can not get it to replace the regular expression with a blank or
"". here is my code:
<code>
function removeRE1() {
var re1 = new RegExp("[\!\@\#\$\%\^\&\*\(\)\_\+\=\{\}\?\<\>\'\;]");
// Get the field value
var strMnPName =
XDocument.DOM.selectSingleNode("/my:myFields/my:MnPName").text;
// Find a match within string s
try {
if (re1.exec(strMnPName) != null){ // && eventObj.Operation == "Insert") {
XDocument.UI.Alert("Please remove any Special Characters!\n ! @ # $
% ^ & * ( ) _ + = { } ? > < ' ;");
strMnPName = strMnPName.replace(re1.exec(strMnPName),"");
}
}
catch (e) {
throw e;
}
}
</code>
Please help!