Delimit char for value parm of <input> tag

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Don

    Delimit char for value parm of <input> tag

    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
  • Don

    #2
    Re: Delimit char for value parm of &lt;input&gt ; tag

    On Sat, 06 Nov 2004 23:49:47 -0700, Don <no@adr.com> wrote:
    [color=blue]
    >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[/color]

    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 =---

    Comment

    • Bent Stigsen

      #3
      Re: Delimit char for value parm of &lt;input&gt ; tag

      Don wrote:[color=blue]
      > On Sat, 06 Nov 2004 23:49:47 -0700, Don <no@adr.com> wrote:
      >
      >[color=green]
      >>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[/color]
      >
      >
      > 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.[/color]

      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 (&#34;) and single quotes (&#39;). For double
      quotes authors can also use the character entity reference &quot;.
      ---

      /Bent

      Comment

      • Don

        #4
        Re: Delimit char for value parm of &lt;input&gt ; tag

        On Sun, 07 Nov 2004 09:17:14 +0100, Bent Stigsen <ngap@thevoid.d k> wrote:
        [color=blue]
        >Don wrote:[color=green]
        >> On Sat, 06 Nov 2004 23:49:47 -0700, Don <no@adr.com> wrote:
        >>
        >>[color=darkred]
        >>>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[/color]
        >>
        >>
        >> 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.[/color]
        >
        > 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 (&#34;) and single quotes (&#39;). For double
        >quotes authors can also use the character entity reference &quot;.
        >---
        >
        >/Bent[/color]

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

        Thanks again,
        Don

        Comment

        • Michael Fesser

          #5
          Re: Delimit char for value parm of &lt;input&gt ; tag

          .oO(Don)
          [color=blue]
          >Hey, thanks much Bent. I'll use one of the alternate ways to represent double quotes.[/color]

          You can use htmlspecialchar s() for that.

          Micha

          Comment

          Working...