473,769 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Delimit char for value parm of <input> tag

Don
Using PHP, I'm creating an <input> tag. How do you delimit the text string for the value parm of an
<input> tag, when the string contains the delimit char?

Example: <input...value= "This text has a " in it"...>

I tried preceeding the " with a the escape char \, but the browser apparently still used the
embedded " as termination of the value string.

One other thing...is the delimiter limited to just " and ' ?

Thanks for any help.
Don
Jul 17 '05 #1
4 2468
Don
On Sat, 06 Nov 2004 23:49:47 -0700, Don <no@adr.com> wrote:
Using PHP, I'm creating an <input> tag. How do you delimit the text string for the value parm of an
<input> tag, when the string contains the delimit char?

Example: <input...value= "This text has a " in it"...>

I tried preceeding the " with a the escape char \, but the browser apparently still used the
embedded " as termination of the value string.

One other thing...is the delimiter limited to just " and ' ?

Thanks for any help.
Don


I just realized I need to tell the rest of the story.

The value for that <input> tag comes from the client, therefore it
might contain any characters, including " and '. And, it might even
contain both of those characters. That's why I'm hoping there is a
way to delimit embedded chars, or a way to use something other than "
and ' for the delimiters.

Don
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jul 17 '05 #2
Don wrote:
On Sat, 06 Nov 2004 23:49:47 -0700, Don <no@adr.com> wrote:

Using PHP, I'm creating an <input> tag. How do you delimit the text string for the value parm of an
<input> tag, when the string contains the delimit char?

Example: <input...value= "This text has a " in it"...>

I tried preceeding the " with a the escape char \, but the browser apparently still used the
embedded " as termination of the value string.

One other thing...is the delimiter limited to just " and ' ?

Thanks for any help.
Don

I just realized I need to tell the rest of the story.

The value for that <input> tag comes from the client, therefore it
might contain any characters, including " and '. And, it might even
contain both of those characters. That's why I'm hoping there is a
way to delimit embedded chars, or a way to use something other than "
and ' for the delimiters.


From the HTML Specification at W3C:
---
By default, SGML requires that all attribute values be delimited using
either double quotation marks (ASCII decimal 34) or single quotation
marks (ASCII decimal 39). Single quote marks can be included within the
attribute value when the value is delimited by double quote marks, and
vice versa. Authors may also use numeric character references to
represent double quotes (") and single quotes ('). For double
quotes authors can also use the character entity reference &quot;.
---

/Bent
Jul 17 '05 #3
Don
On Sun, 07 Nov 2004 09:17:14 +0100, Bent Stigsen <ng**@thevoid.d k> wrote:
Don wrote:
On Sat, 06 Nov 2004 23:49:47 -0700, Don <no@adr.com> wrote:

Using PHP, I'm creating an <input> tag. How do you delimit the text string for the value parm of an
<input> tag, when the string contains the delimit char?

Example: <input...value= "This text has a " in it"...>

I tried preceeding the " with a the escape char \, but the browser apparently still used the
embedded " as termination of the value string.

One other thing...is the delimiter limited to just " and ' ?

Thanks for any help.
Don

I just realized I need to tell the rest of the story.

The value for that <input> tag comes from the client, therefore it
might contain any characters, including " and '. And, it might even
contain both of those characters. That's why I'm hoping there is a
way to delimit embedded chars, or a way to use something other than "
and ' for the delimiters.


From the HTML Specification at W3C:
---
By default, SGML requires that all attribute values be delimited using
either double quotation marks (ASCII decimal 34) or single quotation
marks (ASCII decimal 39). Single quote marks can be included within the
attribute value when the value is delimited by double quote marks, and
vice versa. Authors may also use numeric character references to
represent double quotes (") and single quotes ('). For double
quotes authors can also use the character entity reference &quot;.
---

/Bent


Hey, thanks much Bent. I'll use one of the alternate ways to represent double quotes.

Thanks again,
Don
Jul 17 '05 #4
.oO(Don)
Hey, thanks much Bent. I'll use one of the alternate ways to represent double quotes.


You can use htmlspecialchar s() for that.

Micha
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2593
by: chirs | last post by:
Hi, I want to put a value in a cookie. The following code does not work. It does not store the box1.value in the cookie. How can I fix it? <input type="text" name="box1" onblur=document.cookie="user=" + box1.value> Chris
2
5964
by: not 2 swift | last post by:
I thought I would update an old page on which I had used a <INPUT TYPE=image ...> with a <BUTTON><IMG SRC=...></BUTTON> The problem is that <BUTTON> always provides a shadow/emboss effect. Can I get rid of that? If the old <INPUT> button has been deprecated in favor of <BUTTON>, have all it's button functions been duplicated? Thanks for any help,
3
12198
by: iinet | last post by:
How can i set in my css a min width for input elements, but leave the max size dynamic? Ben
3
13156
by: TR | last post by:
Is it possible with CSS to prevent this wrapping alignment with a checkbox with a nested label? This is the label of the checkbox that wraps beneath it I'd prefer it looked like this, with a flush left margin:
5
2259
by: Bart van Deenen | last post by:
Hi all I have a form with a couple of input fields, embedded within spans. I am using script.aculo.us for dragging and dropping, and want to reorder the input fields that way. The input fields are display:inline because I want them all on the same line. Does anyone know of a smart trick to be able to drag these input fields? Just setting their disabled attribute doesn't work, because then they get no events. Not setting disabled just...
2
5330
by: Mara Guida | last post by:
Hi, After I've populated a page with some <INPUT ...> elements I'd like to have access to whatever is written there. The best I've done (which does not work) is: ================ // ==UserScript== // @name AddInput
2
3386
by: Richard Maher | last post by:
Hi, I'm trying to use the Visibility Style attribute for a Div to effectively PopUp a lightweight window with some additional context-sensitive information, when a user mouses over a given field(s). The popping-up seems to work just fine; it's the tearing down that's giving me grief. If I stick a onmouseout event on the same input field that caused the onmouseover/pop-up, it starts to flicker 'cos the <divis placed for esthetically...
1
2537
by: JPhilS | last post by:
Hi to all Webmaster! I have discover this problem when I inserted the scores of the students i a centain subject. I am making a school project with regards to saving students' record. first, I have to view all students under the certain subject and at the last field, I putted a form to put the scores of each student. say '<input type=text name='score' size=10>' and number of '<input type=text>' is equal to the number of students. I...
1
5507
by: test9991014 | last post by:
Hi folks, I've got something like this: <table> <tr> <td>1</td> <td align=center> <input type=text> </td>
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9416
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9850
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8862
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
3948
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3551
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2810
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.