473,785 Members | 2,498 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Text Box Input - Viewing appended text!!!

1 New Member
I've spent the last couple of hours looking desperately through every corner of the internet for a solution to the following question (and my teeth have been ground down almost to nothing).

With a standard text box input, I am appending a string onto it.. but this resets the view to the beginning of the text box. I want it to scroll on so that the newly added text is visible!! That doesn't seem to much to ask does it? But apparently it is.

[HTML]<input id="chatInput" type="text">

<script type="text/javascript">
document.getEle mentById('chatI nput').value += "hello world";
</script>
[/HTML]
Does anyone have any ideas how to make the new text visible? (Bear in mind this is for a standard input textbox not a textarea which is far more simple). THANKS!!
Oct 29 '07 #1
2 1362
gits
5,390 Recognized Expert Moderator Expert
i've moved the thread from the js-articles section to the forum for you ... please don't post questions in the articles sections

kind regards
Oct 29 '07 #2
acoder
16,027 Recognized Expert Moderator MVP
You may want to set the caret position or create a range. See, for example, this link.
Oct 30 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
17338
by: johkar | last post by:
I have a grid. When the focus is put on a cell an input is created with the value being the cell's text. I would like to size the input to the physical width of the text. Ideas? John function editCell (cell) { if (document.getElementById) { cell.normalize();
1
3833
by: Scott Navarre | last post by:
Hello, I have noticed that when using JavaScript to create a page, the sizes of the text input form elements come out bigger than the size I am trying to set them to. I don't know if it matters, but I am using IE6... For example: if I create a text input with a size of "1" using straight HTML, and then type into it, I can see 2 characters at a time. But when I use JavaScript's 'document.write()' function to create the same text...
2
4992
by: Kai Grossjohann | last post by:
I would like to put a text input field (in the sense of <input type="text">) and an image next to each other, where I know the size in pixels of the image, and I know the total width in em. I haven't found a way to do this. I tried <span style="width:20em"> <input type="text"> <img width="25px" src="...">
8
23493
by: BiNZGi | last post by:
Hi I have reduced the problem to this code: <form> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td><input type="text" style="width: 100%;" value="Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
5
2852
by: Art | last post by:
Hi, I'm using a form text input to display a JavaScript clock. It has no other purpose than that, just show the date and time. What I would like to do now is prevent anything else happening when it's moused over. I was able to remove the cursor using the blur() method, something like this: document.formname.inputname.blur();
4
31048
by: ms | last post by:
I have come across a problem where if a user enters the same text into a text input after the value has been programmatically changed, the onChange event does not fire for the second change. The following code demonstrates this: <html> <body> <input type=text value='yyy' onchange="this.value='xxx'"></input> <input type=text value='2'></input>
18
25006
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin, that IE7 does not seem to offer any way to control the font size of a text input element.
11
12430
by: Mike Harrison | last post by:
Hi, I have some simple HTML like this: <div id="container" style="width:100%;"> <input type="text" <input type="button" style="float:right;" value="Click here..."> </div> I want the button to remain the normal size and be right-aligned, and the edit box to automatically take up the remaining width of the container.
0
1831
by: pazazuzu | last post by:
Hi everyone, I currently have an assignment which I am almost done with but am having problems trying to figure out how to integrate a string function search. I have a text box called $targetstring. My program allows users to input items such as groceries into one text box (item_value) and add an amount to the groceries purchased (amount_value). The program will add the amounts and give a total and will validate the amount_value box for...
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
10341
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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
9954
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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
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...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.