Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How to display a " in an input box

Reply
Thread Tools

How to display a " in an input box

 
 
Stefan Mueller
Guest
Posts: n/a
 
      03-19-2006
How can I display a " in an input box?

I tried
<input type = "text" value = "\"">
without success.

Stefan


 
Reply With Quote
 
 
 
 
Benjamin Niemann
Guest
Posts: n/a
 
      03-19-2006
Stefan Mueller wrote:

> How can I display a " in an input box?
>
> I tried
> <input type = "text" value = "\"">
> without success.


Use either value="&quot;", value=""" or value='"'

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
 
Reply With Quote
 
 
 
 
Stefan Mueller
Guest
Posts: n/a
 
      03-19-2006
>> How can I display a " in an input box?
>>
>> I tried
>> <input type = "text" value = "\"">
>> without success.

>
> Use either value="&quot;", value=""" or value='"'


Isn't there something like the PHP command
addslashes(...)
so that each character gets displayed properly?

Stefan


 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      03-19-2006
"Stefan Mueller" <(E-Mail Removed)> wrote:

> How can I display a " in an input box?


There's no problem with it in input.

> I tried
> <input type = "text" value = "\"">
> without success.


Using it in the _prefilled_ content requires a special method, just as any
inclusion of " into an attribute value delimited with " characters:

<input type = "text" value = "&quot;">

Alternatively, you could use

<input type = "text" value = '"'>

but that's somewhat obscure.

On the other hand, there is _seldom_ reason to include " into the prefilled
(default) content. The idea of using it is probably a wrong approach to the
primary problem, which has not been disclosed.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


 
Reply With Quote
 
Benjamin Niemann
Guest
Posts: n/a
 
      03-19-2006
Stefan Mueller wrote:

>>> How can I display a " in an input box?
>>>
>>> I tried
>>> <input type = "text" value = "\"">
>>> without success.

>>
>> Use either value="&quot;", value=""" or value='"'

>
> Isn't there something like the PHP command
> addslashes(...)
> so that each character gets displayed properly?


'htmlentities' should do the job.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
 
Reply With Quote
 
Stefan Mueller
Guest
Posts: n/a
 
      03-20-2006
> 'htmlentities' should do the job.

Yes, that works. Many thanks
Stefan


 
Reply With Quote
 
Yucky Korpulent
Guest
Posts: n/a
 
      03-20-2006
To elaborate on my previous proclamation that you are "probably [using]
a wrong approach to the primary problem," please be aware that this
assumption is predicated on my belief that most people here are, in
fact, idiots. Idiots with questions that are misguided because they do
not know what they "really" want. Just wanted to clear up any
misconceptions that I may not be an insufferably conceited buffoon.

For more enlightenment on the proper way to solve problems, please
visit http://www.cs.tut.fi/~jkropela/ to see pages so firmly entrenched
in my web authoring dogma that they reek of a website developed circa
1994. This is what you should be striving to achieve.

Yucky,

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
div box questions; float text around a box, fit box to image size Gnarlodious HTML 4 05-05-2010 11:30 AM
How can I make an input box remember an input ? samir.doshi@gmail.com HTML 1 05-30-2006 08:25 AM
Width of text input box vs. password input box cjl HTML 1 10-31-2005 11:46 AM
Off Topic: Width of text input box vs. password input box cjl Javascript 7 10-30-2005 10:11 PM
hide the input box or change the color of input box in html ashutosh Java 3 06-16-2005 02:21 PM



Advertisments