472,993 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,993 software developers and data experts.

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 2421
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.dk> 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 htmlspecialchars() 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
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"...
2
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...
3
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
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...
5
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...
2
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: ================ //...
2
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...
1
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...
1
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
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.