473,785 Members | 2,607 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 2712
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>".$_POS T['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
12050
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
2340
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" ItemStyle-HorizontalAlign="center" ItemStyle-VerticalAlign="top"> <ItemTemplate><%# CType(Container.DataItem("DateStatut"),DateTime).ToString("yyyy-MM-dd") %></ItemTemplate> <EditItemTemplate> <asp:TextBox width="80" CssClass="edit_item" id="txtDateStatut"
4
2147
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', 'Input/Edit Student Details'. 'Student Details' has a field called 'Log Book No' (no duplicates allowed) and this is the Primary Key. 'Exam Details' also has a field called 'Log Book No' (duplicates allowed) and has no Primary Key, (as each...
25
10424
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 for people whose ID is in the list box. I made minor changes to the code (mainly replacing rs.AddNew with rs.Edit)and it appears to be updating only the first record and then overwriting that record with the next, etc until it runs out of ID's...
2
3110
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
1281
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 allows uses to search through the database for the information they need. What the client wants is a web front end which allows some users to edit the core table above. No problem. What the client also wants is for the non-editable web front end...
2
1319
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 they click edit on them, the boxes are populated, and when you click in the box, the cursor stays wherever you click it, when what I want to do is to have it go to the end of the string that's in the text box.
1
2167
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 I have Categories and various Products in each Category. I'm trying to build a page to EDIT/UPDATE each product.I want to be able to change the Category that a product belongs to, but all I get in the drop-down menu is the one specific Category. ...
1
3330
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 (ContactGateway.cfc) - index.cfm - Deals with the business logic - display/form.cfm - Produces the form for both add and edit behaviour
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9481
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8979
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7502
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6741
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4054
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 we have to send another system
3
2881
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.