473,508 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Edit text in input field

Hi,

I wanted to know how you can insert text to the left and to the right
of a marked part of the word. example:
Input field says: ... trees are green ...
By marking this text and using a button I'd like to have
.... <b>trees are green</b> ...

Christian
Jul 17 '05 #1
4 2685
Christian Colberg wrote:
I wanted to know how you can insert text to the left and to the right
of a marked part of the word. example:
Input field says: ... trees are green ...
By marking this text and using a button I'd like to have
... <b>trees are green</b> ...


- This has nothing to do with php. You have to do this with javascript.
- afaik it is only possible using IE
- a possible solution: hm... afair I did that once... some years ago,
but I don't find the script. sorry.

But a better solution is doing it using prompt.

Saludo
Paul.
Jul 17 '05 #2
I noticed that Message-ID:
<86**************************@posting.google.com > from Christian Colberg
contained the following:
I wanted to know how you can insert text to the left and to the right
of a marked part of the word. example:
Input field says: ... trees are green ...
By marking this text and using a button I'd like to have
... <b>trees are green</b> ...

<?php $string="The quick brown fox jumps over the lazy dog";
if (!$_POST['Submit']){
echo $string;}
else{
echo str_replace( $_POST['text'],"<b>".$_POST['text']."</b>",$string);
}
?>
<form name="form1" method="post" action="">
<input type="text" name="text">
<input type="submit" name="Submit" value="Submit">
</form>

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #3
Christian Colberg wrote:
Hi,

I wanted to know how you can insert text to the left and to the right
of a marked part of the word. example:
Input field says: ... trees are green ...
By marking this text and using a button I'd like to have
... <b>trees are green</b> ...

Christian


This should be helpful, plus their beta version works for Mozilla and
Safari type browsers as well
http://www.interactivetools.com/products/htmlarea/

regards
Siggi
Jul 17 '05 #4
Christian Colberg wrote:
Hi,

I wanted to know how you can insert text to the left and to the right
of a marked part of the word. example:
Input field says: ... trees are green ...
By marking this text and using a button I'd like to have
... <b>trees are green</b> ...

Christian

This should be helpful, plus their beta version works for Mozilla and
Safari type browsers as well
http://www.interactivetools.com/products/htmlarea/

regards
Siggi
Jul 17 '05 #5

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

Similar topics

3
12030
by: RRoberto | last post by:
Goodmorning, Is it possible to edit a combobox like a textbox? I will appreciate any suggestion . Thank You Roberto
8
2314
by: Gilles T. | last post by:
How I can get element ID in the edit mode of datagrid control? If I not in the edit mode, there are no problem. <asp:TemplateColumn ItemStyle-CssClass="grid_column_width_3"...
4
2124
by: Terry | last post by:
I need some help refining an MS 2000 relational databse. I have created a simple relational database using two tables, 'Student Details', 'Exam Details' and two forms, 'Input/Edit Exam Details',...
25
10357
by: dixie | last post by:
I have some code that adds new records into a table for each ID in a list box when a button on a form is clicked. This works fine. My problem now is that I wish to be able to edit all the records...
2
3095
by: Michael Blair | last post by:
I would like to edit an incoming date field which is mm/dd/yyyy and convert it to yyyy-mm-dd as required by mysql. Any ideas?
2
1263
by: Roy | last post by:
Hey all, This is a general question. Here's my scenario: We have a legacy database. The core table within contains almost 4 million records in SQL Server. Currently we have a web front end which...
2
1309
by: Blasting Cap | last post by:
I have a couple fields (one varchar 20, one varchar 500) for a PO Number & a comment field on a datagrid. Once they're entered, a user can edit them and make changes to them. However, when...
1
2150
by: ollielaroo | last post by:
Hi guys, Firstly I did do a search for this one first but I couldn't find anything related in this forum. I am using Dreamweaver MX and trying to build admin pages for an ASP site. My problem is...
1
3301
by: chromis | last post by:
Hi, I'm having trouble fully implementing the edit section of a contact admin system, so far I have written the following: - Bean (Contact.cfc) - Data Access object (ContactDAO.cfc) - Gateway...
0
7226
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,...
0
7125
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...
0
7328
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,...
0
7499
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...
1
5055
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4709
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1561
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 ...
1
767
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
422
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...

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.