473,398 Members | 2,120 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,398 software developers and data experts.

Clear text area with button click

How can I clear a text field by clicking on a button?

Ive searched the web and found tons of scripts that will clear text just
entered but I am displaying results from a database into a text area field.
I need to be able to click a button and clear the field completely - not
just the text that was just entered.

BTW - There is only one field on the form so a routine that will clear an
entire form would work.

TIA

Jul 20 '05 #1
3 35689
Targa, on Tue, 04 Nov 2003 01:38:54 -0600, had to say:
How can I clear a text field by clicking on a button?


<input type="button" value="Clear"
onlick="document.formname.textareaname.value = '';">

Jul 20 '05 #2
In article <10***************@cache5.usenetserver.com>, "Targa"
<ta*************@alltel.net> writes:
BTW - There is only one field on the form so a routine that will clear an
entire form would work.


<input type="reset" value="Clear The Form" />
--
Randy
Jul 20 '05 #3
Mikhail Esteves wrote:
Targa, on Tue, 04 Nov 2003 01:38:54 -0600, had to say:
How can I clear a text field by clicking on a button?


<input type="button" value="Clear"
onlick="document.formname.textareaname.value = '';">


<input
type="button"
value="Clear"
onlick="this.form.elements['textareaname'].value = '';">
PointedEars

Jul 20 '05 #4

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

Similar topics

20
by: Dannyboyo | last post by:
I have what I hope is a simple request. I can't really code in javascript, but I am pretty good at cusomizing it with slight modifications. I code in ASP and HTML. I am trying to capture customer...
7
by: Razzbar | last post by:
I have a textarea and some buttons. The buttons apply functions to the text the user selects, i.e. the good old "wrap with a tag" thing we all have seen in 100 different editors. Trouble is,...
3
by: PeP | last post by:
Good morning, I have a form containing a text-area, I'd like to know if it exists a function that, when I activate an event, returns the position of the cursor in the text-area. For example, I...
3
by: Jake | last post by:
How can I have an image that when clicked would clear my textarea field? The textarea field is the only element in my form and has a default value - a couple lines of text.. I tried using a...
4
by: Patrick.O.Ige | last post by:
Whats the best way to clear textboxes? Any ideas?
21
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each...
0
by: Flack | last post by:
I have pasted at the end of this message a small sample program I whipped up to do some testing. It's a form with a datagrid and two buttons. Each button clears the dataTable that is the source...
0
by: Amy | last post by:
I am using ASP.NET. I have 3 web server controls on my page. One is textbox1 with AUTOPOSTBACK = true. The other one is another textbox2 with AUTOPOSTBACK = false. The third item is a save button....
3
by: santhosh89 | last post by:
hi guys, see i want to develop a script and developed one but it s not working. the concept is there will be three radio buttons. the user has to check one radio button and click the button next...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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...
0
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...

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.