The single-quote character (')
Questions tagged [apostrophe]
475 questions
9
votes
3 answers
Escape apostrophe when passing parameter in onclick event
I'm passing the company name to an onclick event. Some company names have apostrophes in them. I added '.Replace("'", "'")' to the company_name field. This allows the onclick event to fire, but the confirm message displays as "Jane 39;s Welding…
![](../../users/profiles/239793.webp)
RememberME
- 2,072
- 3
- 35
- 62
9
votes
3 answers
PHP Array access without quotes
I knocked to a phenomenon in an existing php source,
with field access without apostrophe like this: $_GET[test].
I got unsure, also don't know, that this is a possible way,
so I wrote a short example for testing:
echo "Array Test, fields without…
![](../../users/profiles/1551609.webp)
Peter
- 93
- 1
- 3
8
votes
1 answer
Change UIKeyboardType based on text input
I'm trying to change the UIKeyboardType to the alphabet keyboard when the user types a space, mirroring the effect of typing an apostrophe. However, my code won't change the keyboard appearance until the user dismisses the keyboard and then brings…
![](../../users/profiles/1176156.webp)
MaxGabriel
- 7,317
- 4
- 32
- 77
7
votes
2 answers
Python XPath parsing tag with apostrophe
I'm new to XPath. I'm trying to parse a page using XPath. I need to get information from tag, but escaped apostrophe in title screws up everything.
For parsing i use Grab.
tag from source:
![](../../users/profiles/1091618.webp)
Stanislav Golovanov
- 71
- 3
7
votes
3 answers
how to encode apostrophes for a webpage
i am using the cluetip plugin and the simple use case is to to put the content in a title attribute, like below:
Text
i am now running into issues where the string that is inside "detail content' has an…
![](../../users/profiles/4653.webp)
leora
- 163,579
- 332
- 834
- 1,328
7
votes
2 answers
apostrophes are breaking my mysql query in PHP
My database has name records that occasionally contain apostrophes, such as Joe's Bar and I've just coded a query script in PHP that grabs that field and sticks it into a select statement with the usual $query = "SELECT address FROM restaurants…
![](../../users/profiles/188930.webp)
Drew
- 5,970
- 10
- 42
- 67
7
votes
2 answers
DataTable select method with single quote conflict C#
I recently found when I do a LINQ select under a field that contains an apostrophe, it makes my application to throw an exception.
DataRow[] newDr = this.ds.Tables["TableName"].Select("Name = '" + drData["Name"].ToString() + "'");
If drData["Name"]…
![](../../users/profiles/2532403.webp)
Maximus Decimus
- 4,175
- 19
- 55
- 83
6
votes
8 answers
OLEDB, Writing Excel cell without leading apostrophe
I'm writing to Excel file using OLEDB (C#).
What I need is just RAW data format.
I've noticed all cells (headers and values) are prefixed by apostrophe (')
Is it a way to avoid adding them in all text cells?
Here is my connection string:
string…
![](../../users/profiles/77273.webp)
Maciej
- 9,237
- 16
- 59
- 83
6
votes
2 answers
What is the correct way to support apostrophes in javascript when building up html?
i have the following code:
var name = "Joe O'Neal";
var row= [];
row.push(
"
" + name +…
![](../../users/profiles/4653.webp)
leora
- 163,579
- 332
- 834
- 1,328
6
votes
3 answers
JSON value with apostrophe
I have an element with a rel attribute that contains a JSON string, something like:
rel='{"id":"#id#","name":"#name#"}'
Then, in my javascript code, I use $.parseJSON to parse this data. This works correctly - besides for cases where name contains…
![](../../users/profiles/259541.webp)
froadie
- 71,770
- 69
- 154
- 228
6
votes
5 answers
Replace " ’ " with " ' " in PHP
I'm grabbing a string from the database that could be something like String’s Title however I need to replace the ’ with a ' so that I can pass the string to an external API. I've used just about every variation of escaped strings in str_replace()…
![](../../users/profiles/397476.webp)
Mike R
- 903
- 1
- 8
- 13
5
votes
1 answer
Are apostrophes valid containers for HTML element attribute values?
Usually HTML element attribute values are marked with a quotation mark, like
Sometimes, however, you see code like
Is it valid HTML and can it cause any problems? What…
![](../../users/profiles/76777.webp)
simon
- 11,971
- 24
- 73
- 108
5
votes
2 answers
Usage of single quotes in SQL queries
I have the following SQL query:
SELECT id_zam AS test,
CASE WHEN (SELECT something FROM sth WHERE id_something = test) = 1
THEN
'true'
ELSE
'false'
END as test_result
FROM…
![](../../users/profiles/3921353.webp)
XardasLord
- 1,706
- 2
- 18
- 37
5
votes
1 answer
apostrophe text comparison in xsl
I have a problem with text with apostrophe symbol
example i try to test this xml having the symbol is then how can i compare ?
this is statement showing error
Regards
Nanda.A
![](../../users/profiles/193658.webp)
Nanda
- 211
- 3
- 9
4
votes
4 answers
Replacing apostrophe in asp.net to prevent SQL error
I have a web-form with a Name field which I want to be able to accept single apostrophes, such as in the name O'Leary, but when trying to push this record to the SQL 2005 server, I get an error. My question is not this. It's that when I attempt to…
![](../../users/profiles/953427.webp)
Jim
- 43
- 1
- 3