Insert an hidden character in text string using JavaScript - This question was answered by suggesting the OP try alternative actions to accomplish his/her goal. The question is unanswered in my opinion. So how is it done? How do you insert a hidden character into a string. Hidden character must serve as a delimiter in a list where list items can contain common delimiters like commas and and such. Use of tagged technologies only...
Asked
Active
Viewed 7,003 times
0
-
You mean you need to insert a space in your string? – Mohammad Areeb Siddiqui Jul 06 '13 at 15:50
-
What do you mean by, "Use of tagged technologies only..."? – Herbert Jul 06 '13 at 16:23
-
1The reason they didn't answer the question you linked is because the OP presented an [XY Problem](http://meta.stackexchange.com/a/66378/168341) where there's a better solution than that proposed by the OP. Perhaps that's the case here as well. – Herbert Jul 06 '13 at 16:30
-
1Well you can use custom tags like `lol
lol`. The browser will parse it and show nothing `lol lol` but you can still use it for other *vague* purposes. Note that with this you're violating all standard specifications which means your document is not (x)html(5) valid... – HamZa Jul 06 '13 at 18:14 -
I'm sorry if I was vague. I need to store a list of values in a DB, but I do not want to separate values by a comma, since a comma is present in some values, e.g. San Francisco, CA. So I thought that a hidden character would be less ambiguous. – Nag Hammadi Jul 06 '13 at 23:51
-
@Herbert Tagged as in tagged in post: PHP javascript html and mysql. Use of these technologies to accomplish the goal. – Nag Hammadi Jul 06 '13 at 23:54
-
@MohammadAreebSiddiqui I need to separate values with a character that isn't present in any of the values. – Nag Hammadi Jul 06 '13 at 23:55
-
@Herbert I'm open to suggestions concerning your "better solution" – Nag Hammadi Jul 06 '13 at 23:56
-
@HamZa Hmmm. You got a point, as well as a solution. #indecisive – Nag Hammadi Jul 06 '13 at 23:57
2 Answers
0
This question: Unicode to a Form with Javascript shows how to add Unicode characters to a text field via JavaScript. It satisfies me sufficiently for me to consider it as the correct answer.

Community
- 1
- 1

Nag Hammadi
- 297
- 1
- 6
- 17
-1
Well you can use the unicode control character
<span id="taggable">lo
l</span>
gives
lol
And if you want to add it you can do something like:
var span= document.getElementById('tagabble');
span.innerHTML +='
';

raam86
- 6,785
- 2
- 31
- 46
-
1Control character! http://en.wikipedia.org/wiki/Unicode_control_characters – raam86 Jul 07 '13 at 00:01
-
How would u add this character to a text field. When I add it to a text field it shows the character code in the field, visible to all. – Nag Hammadi Jul 07 '13 at 04:05
-