frm_title = Replace(frm_title,"'","''") not working

B

bronskimac

I have a function to cope with " and ' in a form field. The quotes replace
works fine but the apostrophe one does not. this is driving me nuts.

function clean_text()
frm_title = Replace(frm_title,"'","''")
frm_title = Replace(frm_title,"""", """""")
end function

I know this topic keeps coming up, I have searched the vbscript newsgroups
and can not see where I am going wrong.

Bronski
 
A

Aaron [SQL Server MVP]

function clean_text()
frm_title = Replace(frm_title,"'","''")
frm_title = Replace(frm_title,"""", """""")
end function

Uh, is this your actual function???


Maybe you should try:


function clean_text(str)
clean_text = Replace(str,"'","''")
end function
response.write clean_text(frm_title)


Not sure why you think you have to replace " ... these will enter the
database just fine.

--
http://www.aspfaq.com/
(Reverse address to reply.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,158
Messages
2,570,882
Members
47,414
Latest member
djangoframe

Latest Threads

Top