Apostrophe Replacement
I know this is a very commonly asked question, but I can't find a solution
anywhere that I have looked.
I need to take the text that will be typed in paragraph form by the user
(textarea field) and do two things with it:
1. Store it in a SQL Server database field
2. Send it in an email upon page submit.
Of course, single quotes have caused problems, so I have this code:
strInternalDesc =
Replace(Trim(Request.Form("InternalDesc")),"'","''")
Problem is, it shows up like this in the email that is sent:
==============================
We''re in the process of
==============================
I would like to get rid of the double apostrophes, but not sure how. Went to
an article on ASPFAQ, and saw something which directed me to do this:
strInternalDesc =
Replace(Trim(Request.Form("InternalDesc")),"'",chr(34))
However, that just makes it a regular double-quote. I guess I could try and
find out what the character number for apostrophes are, but not sure where
that is. Besides, will that mess up my SQL Server or the email if I do that?
View Replies
ADVERTISEMENT
Does anyone know of an ASP (VBScript) that can function as a Yahoo Group
style replacement? This includes handling digest emails as well. All the
popular forum software I've looked at, such as Snitz, can't handle it.
View Replies
View Related
I have just upgraded my win98SE pc to winxp home. I am aware that PWS won't work with xp home, and I need to upgrade to XP pro for IIS. Problem is that I don't really want to upgrade unless I have to.
I've been investigating the various server options available. I need to run .asp scripts and connect to access 2000 databases. I'm not sure what servers will do this as the documentation is never that clear. Will Apache do what I want, and is there a duffers guide to getting it running?
View Replies
View Related
Can anyone recommend a CyberCash replacement for ASP(x)?
View Replies
View Related
Is it possible to make another file act likle global.asa? at the moment my project uses this file but im not sure how many hosts allow users access to it, so if i could just include another file and make it act like the global.asa that would be great.
View Replies
View Related
Not strictly an ASP question, but it's for an ASP-based content management system:
I'm looking for a good, free textarea replacement application which creates a WYSIWYG interface from form textareas. I have used HTMLArea in the past but it only works on IE6.
Does anyone know of such a thing?
View Replies
View Related
I want to use asp to do text find and replace with XHTML elements. for example, let's say I have the following XHTML:
<note>
<from id="123">Jani</from>
<to>Tove</to>
<message>Norwegian: æøå. French: êèé</message>
</note>
I want to read this document in, find and XML element with id="123" and replace its text with "New author".
Can I do this in ASP?
View Replies
View Related
I skinned an LMS (Learning Management System) using CSS and Javascript. The forms were skinned with niceforms.js, the site works perfectly in FF, IE 7 and IE6 but in ASP the javascript doesn't replace the images with the skinned elements. All the javascript functions initialize but the images are not placed in. Code:
View Replies
View Related
While debugging why a web.config section replacement was not happening in the real web application, I tried a simplified case, no replacement is enabled and the connection string is not showing up? Code:
View Replies
View Related
I am getting a bug with regards to submitting an ASP form. Here's the scenario:
I am entering info in a form and calling an ASP page to process it. I am collecting info from the fields like so Code:
View Replies
View Related
I’ve a form with a textbox called Message. When visitor enters text, I use Replace function to handle an apostrophe code that will receive the text and store in the database.
It works fine.
When I try to retrieve the text message, it doesn’t show what I’ve in the DB, but it displays, for example: I?m. It supposes to display as “I’m”
I did try:
<%message= Replace(trim(RS("message")),"'","''")%>
<td><p><%=message%></p></td>
View Replies
View Related
i have a textarea in my form, and it worked. but if the input text contains apostrophe, i would get sth like this:
Microsoft OLE DB Provider for ODBC Driverserror '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''rtert'','Judy Nadia Jolonius');'. /saveRemarks.asp, line 195
how can i make asp ignore the apostrophe?
View Replies
View Related
I know a few ways to handle an apostrophe, but am at a loss for which i should use for this. The ways I know how to deal with it are.
alias = Replace(Request.form("alias"), "'", "''")
alias = Replace(Request.form("alias"), "'", " & #39; ")
The name of the field is self explanitory. When the admin searches for a person using the "'" , " ' ' " method they find the user. But when ever we display that info anyware it has the O''conner setup. Code:
View Replies
View Related
I'm trying to query a database where some records contain apostrophes in them. Is there an effective way to do this?
View Replies
View Related
I am running into a very common problem that i cannot seem to find a solution for. I have an access database with a text field. Some of the records will contain an apostrophe. i have used the replace method to escape the apostrophe and turn it into ~~~. I can sucessfully change that back to an apostrophe everywhere but a text box. Here is my code:
response.write "<input type=text name=title" & icount & " value='" & replace(rs("title") ,"~~~", "'") &"' size=55><br>"
View Replies
View Related
Below is the code I use to send data from form to database. Problem is if an apostrophe is entered in cQuestion field or any field for that matter the form errors out. Code:
View Replies
View Related
When I want to execute a SQL statement (as we all know) certain characters will cause an error. You can't execute a statement with a " in one of the parameters or else the command will stop short and result in an error.
Let's say for example that I'm trying to update a field named "code" and the value of the field "code" is: Code:
View Replies
View Related
I currently have a simple html page that consists of a text box and submit button. A user supplies a quote in the text box and presses the submit button. When the submit button is pressed the quote is added to a ‘Quote’ table in an MS Access database.
This works perfectly well, however if a quote contains an apostrophe, such as … this won’t work… It will not add to the database. If I had typed in …this wont work… It would be added to the database with no problems. Code:
View Replies
View Related
how to add the symbol ' (Apostrophe) to the code so that the validation accepts this within a surname such as o'neill? this is wot i hav at the minute:
With regExName
.Pattern = "^[a-z]+$"
.IgnoreCase = true
.Global = true
End With
View Replies
View Related
how to accept ' or apostrophe when adding on the database? because I created a simple guestbook and when i tested it it works fine but once i add apostrophe like TOY'S etc it generates error.
View Replies
View Related
I am having a problem with the apostrophe not showing up correctly when doing a mysql query and returning the data.
I am using a function to keep apostrophes from causing the queries to fail and the data that does get displayed to the user (html) turns out right 90% of the time but on a certain page it displayes the apostrophy twice instead of once. Here are the relevant pieces of code:
View Replies
View Related
I am using a Replace function to replace single quotes with double when
submitting a text field in the database i.e. Replace (q, "'", "' ' ")
which works fine. When I retrieve the field from the database which has
apostrophe I am getting 'Object expected' error message. Is there a
way to fix this?
View Replies
View Related
Isn't there some line of code that I can write to tell ASP to treat everything between BLAH and /BLAH as text (including the apostrophe). So that users can type a name of "O'Malley" in a form and I can retrieve it and store it in my database.
View Replies
View Related
What is the correct data type to use if the phrase I'm saving to my table contains an apostrophe such as in the phrase "yesterda's news". I've tried "text" data type, I've tried "varchar" and "char". They all give me bugs when I save to the database and if I remove the apostrophe from the phrase, then it saves correctly with any data type.
View Replies
View Related