
March 22nd, 2003, 09:03 AM
|
|
Registered User
|
|
Join Date: Feb 2003
Posts: 4
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
The search feature is currently down, so I hope someone will kindly help me out. I'm having a problem with special characters when I display the post. Before I insert the post into the database I remove the special characters -
Quote: sMessage = replace(replace(replace(replace(replace(replace _
(replace(replace(request.form("post_message"),"&","&"),_
"@","@"),"!","!"),"%","%"),_
";",";"),"<","<"),">",">" ),"'","'") |
and when displaying the post i put them back in -
Quote: sPostMsg = rsPosts("post_message")
response.write replace(replace(replace(replace _
(replace(replace(replace(replace _
(sPostMsg, "&","&"),_
"@","@"),"!","!"),"%","%"),";",";"),_
"<","<"),">",">" ),"'","'") |
This works fine unless the poster has added additional spaces, in which case the output looks like this -
Quote: | some text the poster wrote |
I tried to accomodate the spaces with <pre> tags, not a solution. I know the problem has to do with replacing the ampersand character before inserting, but i can't figure out how to replace the character and preserve the poster's spacing format.
As for the previous question, since the search is currently down... your javascript needs this function -
Code:
//OnSubmit, pass value from iframe to the DB
function Process() {
// Assign the HTML code to a hidden form variable
var htmlCode = iView.document.body.innerHTML;
document.form2.post_message.value = htmlCode;
return true;
}
and your form tag needs this -
Code:
<form name="form2" id="form2" onSubmit="return Process()">[
in addition to the method and action attributes. When the search feature comes back up type in wysiwyg, this one is pretty easy to find.
Last edited by an-ath : March 25th, 2003 at 10:09 AM.
|