formatting specified string in textarea field

Discussion in 'Javascript' started by K., Nov 8, 2006.

  1. K.

    K. Guest

    I have such a text

    <input type="text" name="search_txt" value="">
    <textarea name="txt_m">
    My hobby is bicycle.
    My hobby is driving a car.
    </textarea>

    I would like to bold and color a specified text
    in input field search_txt for instance "hobby" string.

    How to do that in JS?

    Thank you in advance
    Marcin
    K., Nov 8, 2006
    #1
    1. Advertising

  2. K.

    RobG Guest

    K. wrote:
    > I have such a text
    >
    > <input type="text" name="search_txt" value="">
    > <textarea name="txt_m">
    > My hobby is bicycle.
    > My hobby is driving a car.
    > </textarea>
    >
    > I would like to bold and color a specified text
    > in input field search_txt for instance "hobby" string.
    >
    > How to do that in JS?


    You can only apply the style properties that textarea elements support.
    They can be applied to the textarea as a whole (e.g. font-family or
    weight), the effect may work or not depending on browser support for
    the particular property.

    Full details (but not browser support) are in the W3C CSS spec, their
    CSS property table provides hints:

    <URL: http://www.w3.org/TR/CSS21/propidx.html >

    A CSS group may provide more information

    news:comp.infosystems.www.authoring.stylesheets
    <URL:
    http://groups.google.com.au/group/comp.infosystems.www.authoring.stylesheets?lnk=li
    >



    --
    Rob
    RobG, Nov 8, 2006
    #2
    1. Advertising

  3. K.

    K. Guest

    Uzytkownik "RobG" <> napisal w wiadomosci
    news:...
    > K. wrote:
    >> I have such a text
    >>
    >> <input type="text" name="search_txt" value="">
    >> <textarea name="txt_m">
    >> My hobby is bicycle.
    >> My hobby is driving a car.
    >> </textarea>
    >>
    >> I would like to bold and color a specified text
    >> in input field search_txt for instance "hobby" string.
    >>
    >> How to do that in JS?

    >
    > You can only apply the style properties that textarea elements support.
    > They can be applied to the textarea as a whole (e.g. font-family or
    > weight), the effect may work or not depending on browser support for
    > the particular property.
    >
    > Full details (but not browser support) are in the W3C CSS spec, their
    > CSS property table provides hints:
    >
    > <URL: http://www.w3.org/TR/CSS21/propidx.html >
    >
    > A CSS group may provide more information
    >
    > news:comp.infosystems.www.authoring.stylesheets
    > <URL:
    > http://groups.google.com.au/group/comp.infosystems.www.authoring.stylesheets?lnk=li
    >>

    >
    >
    > --
    > Rob
    >



    Could you be so kind and write me a small code example?

    Thank you in advance
    Martin.
    K., Nov 8, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Augustus
    Replies:
    1
    Views:
    340
    Ken Schaefer
    Sep 10, 2003
  2. Textarea Inside of a textarea

    , Feb 4, 2006, in forum: ASP General
    Replies:
    6
    Views:
    318
    Anthony Jones
    Feb 5, 2006
  3. Sound
    Replies:
    2
    Views:
    430
    Randy Webb
    Sep 28, 2006
  4. Replies:
    1
    Views:
    298
    Bart Van der Donck
    Jul 4, 2007
  5. jr
    Replies:
    3
    Views:
    410
Loading...

Share This Page