473,473 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to detect a textarea and insert onKeyPress into that textarea using javascript?

2 New Member
I would like to detect a textarea in a form using javascript. And insert onkeypress into that textarea.
I do no want to change original html code for textarea.
I just want to add <script> tag in header section of a page and that <script> tag detect textarea in that page and insert onkeypress event into textarea
Thanks.
Feb 5 '11 #1
1 2276
RamananKalirajan
608 Contributor
Hi Sithu Thwin,
Check out the function "getElementsByTagName()" it will work in Mozilla and alternate code are available for IE. This method will help you in getting the "Textarea" object. Use "setAttribute" or .onKeyPress= or add Event Key Listener for that TextArea.

Thanks and Regards
Ramanan Kalirajan
Feb 8 '11 #2

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

Similar topics

1
by: onewebclick | last post by:
Is there a way to detect a browser cache is full using javascript or HTML thorugh a web page and inform the user to clear the cache to improve performance of the website. It looks like google's...
4
by: zborisau | last post by:
Hey good people, I've been given a problem to solve recently - and stuck with the solution for a good 4 days already. i have a link which leads to popup window. the purpose of that popup...
2
by: Joe Fallon | last post by:
I can add items to my dropdown list using javascript like this: cbo.length = j+2; cbo.options.text = "Some Text"; cbo.options.value = "MyValue"; cbo.options.text = "Some Other Text";
6
by: SRafiq | last post by:
Hi I need help with a topic I have an html page and in it i have a textarea which can have a multiple of info, is there any possible way that i can out put a specific area of the textarea using...
1
by: snipersix | last post by:
How do you display values in a textarea using javascript. ex. i have 2 radio buttons o Adult =$9.99 o Child =$6.99 i need it to be, so that if i select adult in the...
2
by: AmitKu | last post by:
<script> function CheckChange() { var mycheck = document.getElementById('test'); mycheck.check = true; } </script> <body> <form id="form1" runat="server">
7
by: u01jmg3 | last post by:
hi, i just wondered if there was a way (like there is in firefox) using javascript to allow a user using IE to drag a hyperlink (without highlighting it) and if dragged over a textarea that the text...
1
by: gaya3 | last post by:
Hi, How to insert row in table using javascript when some event occurs in html? -Hamsa
1
by: silviya | last post by:
Hi all: I am in a need to insert a link to the textarea dynamically using javascript. That works for IE,Mozilla and FireFox. I got a code that works for Mozilla but not for IE. I need this...
6
by: swethak | last post by:
Hi, I displayed the image taken from database.How to raotate that image using javascript.plz tell that how to start the logic.plz tell that some reference websites.
0
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
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
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,...
1
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...
0
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,...
1
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
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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.