 |
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

August 10th, 2005, 12:19 AM
|
Registered User
|
|
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
|
|
Text Replacement Problem.
HI All,
I m using flw func to store text in db.
Function StoreText(theText)
StoreText = ""
on error resume next
StoreText = CStr(theText)
if (len(StoreText) > 0) Then
StoreText = Replace(StoreText, """", """, 1, -1, 1)
StoreText = Replace(StoreText, "'", "''", 1, -1, 1)
StoreText = Replace(StoreText,"<","<", 1, -1, 1)
StoreText = Replace(StoreText,">",">", 1, -1, 1)
StoreText = Replace(StoreText, vbCrLf, "<BR>", 1, -1, 1)
end if
End Function
now problem comes when i want to edit the text stored by this function and that prob is only for ", since this is replace by "e; when user tries to modify text, it gets value with "e; e.g.stored text is - I will "call" u. Will be display like - I will "e;call"e; u.
Thanks in advace.
Rupen Anjaria.
We CAN'T avoid problems, but can solve it.
|

August 10th, 2005, 12:26 PM
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
|
|
Hi
while retreiving the data r u using any function? Because when u display the data for editing, you need to replace """ with """"
Om Prakash
|

August 11th, 2005, 04:32 AM
|
Registered User
|
|
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
|
|
HI,
Ofcourse, I am using a function:
---------------
Function EditMemo(theText)
EditMemo = ""
on error resume next
EditMemo = CStr(theText)
if (len(EditMemo) > 0) Then
EditMemo = Replace(EditMemo,"<br>",vbCrLf, 1, -1, 1)
EditMemo = Replace(EditMemo, """, "CHR(32)", 1, -1, 1)
EditMemo = Replace(EditMemo,"<","<", 1, -1, 1)
EditMemo = Replace(EditMemo,">",">", 1, -1, 1)
EditMemo = Replace(EditMemo, "''","'", 1, -1, 1)
end if
End Function
----------------
The prob is with :
EditMemo = Replace(EditMemo, """, """", 1, -1, 1)
I have to replace " with "
I hope to be clear now!!
Rupen Anjaria.
We CAN'T avoid problems, but can solve it.
|

August 11th, 2005, 06:53 PM
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
|
|
Hi,
This is what i understand with your comments:
You use StoreText function to convert your text before storing in database and use EditMemo to get the data into a textbox.
When you use StoreText, to store, the instead of double quotes, """ is stored in the database. While displaying this in a text box, in EditMemo function, how r u getting the data as ""e;"..?
Please remove the following line form EditMemo function:
EditMemo = Replace(EditMemo, """, "CHR(32)", 1, -1, 1)
To display double quotes in a textbox, you need to use "
This string will be displayed properly in the textbox:
- I will "call" u.
Hope this will help..
Om Prakash
|

August 12th, 2005, 04:00 AM
|
Registered User
|
|
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
|
|
HI,
I think u r getting confu with this, EditMemo is used to edit/modify the text entered by user, say i have written something and i want to modify that.
so while getting data in a textbox or textarea i have to convert "e; to ", else text will be displayed awkward.
I hope this suffiece!!:)
Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
|
|
 |