473,385 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

formatting specified string in textarea field

K.
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
Nov 8 '06 #1
2 1901
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/co...esheets?lnk=li
>

--
Rob

Nov 8 '06 #2
K.

Uzytkownik "RobG" <rg***@iinet.net.aunapisal w wiadomosci
news:11**********************@b28g2000cwb.googlegr oups.com...
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/co...esheets?lnk=li
>>


--
Rob

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

Thank you in advance
Martin.
Nov 8 '06 #3

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

Similar topics

5
by: bonehead | last post by:
I am using a php html form with data which is loaded from a mysql database. Three of the fields are textareas. The data loads into these fields fine, except that the loaded text starts at what...
6
by: Matt | last post by:
I have a textarea that is populated from a blob within a database. Everytime the data is pulled, however, there is always a lot of leading space characters before the actual text. It is not in the...
2
by: JStrummer | last post by:
I'm building an ASP-based CRM system; a user sees the original message, posted from the database and can hit a Reply button to generate a TEXTAREA field on the next page that houses the original...
6
by: TomT | last post by:
Hi, I've created a form that has a 3 fields. 2 textboxes (username & password) 1 TextArea (notes) I have linked this to an access DB. This is working well, the user enters thier Username...
4
by: deko | last post by:
I've heard it's best not to have any formatting specified for Table fields (except perhaps Currency), and instead set the formatting in the Form or Report. But what about Yes/No fields? When I...
10
by: Perry van Kuppeveld | last post by:
Hi, I have a problem with formatting a table including text fields wich can contain up to 255 chars. I need a table with 3 columns: - First column 50 % over the with a rowspan of the total...
8
by: G.Ashok | last post by:
Hi, I have created CultureInfo object and specified required digit grouping in it. The one of the overloaded ToString methods of Decimal type has parameters to format the value with required...
4
by: monomaniac21 | last post by:
Hi all On my site I get users to enter a load of information in a textarea box, however when i save this data to my mysql DB and then retrieve it, it comes out without all the formatting, like...
11
nathj
by: nathj | last post by:
Hi, I am working on new version of a site that requires an application form for membership, this is so that certain features of the site are only available to members. The site is aimed at Church...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.