|
-
Sep 23rd, 2004, 12:19 AM
#1
Thread Starter
Fanatic Member
Throwing variables around[RSLV]
Ok, heres the problem. Take alook at this line.
HTML + ASP\Javascript
Code:
<INPUT TYPE="TEXT" NAME="txtBody" VALUE="<%=objCategory('Body')%>">
Whats wrong with this line you may ask. Well, objCategory is a recordset that is pulling up a field. If there is a ' or " in that field it totally messes up the text input. Thats not the worst of it, if there is a \n character in there or something it starts writing outside of the text field all over my page. How can i fix this?
Looking for ' and " and replacing them with \' \" is one option. How do i search for new lines though.
I'm using ASP with JScript.
Ugh how frustrating.
Thanks ladies and gents
Last edited by invitro; Sep 23rd, 2004 at 08:32 PM.
ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet? 
-
Sep 23rd, 2004, 01:01 AM
#2
First, when the data was being inserted, you should have done a
Replace(stringname,"'","''")
For now, when retrieving and displaying values, use the Replace() function and look for ' and " and vbCrLf.
-
Sep 23rd, 2004, 08:32 PM
#3
Thread Starter
Fanatic Member
The thing is that I'm using JScript, so there is no such thing as vbCrLf, is there?
Second, i solved the problem by using a text area instead. Textareas seem to be unaffected by terminating charcters and so on since you are not inserting something in the VALUE but the field itself <>my text'</>
So, for the future, search for ' and " and replace them with \' & \" ... i still dont know what newline is in Jscript oither then \n but that didnt seem to work.
Anyhow, thanks for the reply i seem to got it working somehow.
Cheers!
ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet? 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|