473,387 Members | 1,517 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,387 software developers and data experts.

Clear multiple textareas with a function.

Hi guys.

I have 3 textareas, and I have a button to clear them.
I used a standard form with onlick="document.formname.textareaname.value = '';">
But it stopped working when there was added more textares within the form area.

I tried moving the form, using various functions found on google, but they didnt support the idea of clearing mutliple textareas at once.

So how is this done?
thanks
Oct 9 '09 #1
2 2248
Frinavale
9,735 Expert Mod 8TB
Have you considered giving the textarea an ID?

That way you can retrieve that particular textarea element using the document.getElementById() method.

Or you could use the document.getElementsByTagName() method to retrieve all textareas and textboxes then loop through the array returned to clear the text in these elements.

-Frinny
Oct 9 '09 #2
Thanks for your answer.

I touched that function briefly, but I was never able to complete it.
I dont really know any javascript worth using, so I was hoping you guys could maybe show me how.

Thanks
Oct 9 '09 #3

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

Similar topics

6
by: stuart | last post by:
I have two textareas on a HTML page. If a user scrolls in one textarea I want the other textarea to scroll as well. In otherwords I want both textareas to scroll up and down in unison. Can...
5
by: Mark | last post by:
How do I scroll two textareas in sync with FireFox/Mozilla? The IE solution has been posted before by Martin Honnen.
22
by: mp | last post by:
i have a python program which attempts to call 'cls' but fails: sh: line 1: cls: command not found i tried creating an alias from cls to clear in .profile, .cshrc, and /etc/profile, but none...
16
by: Brian D | last post by:
I have a multiple select list that is created dynamically based on a previous selection on an asp page. The first thing I do is to clear the curent option list by ...
4
by: Adrian Parker | last post by:
We've suddenly started getting a problem with a call to clear the contents of a DataTable. This is on a live customer site that's been working fine until yesterday. As far as we know they've not...
1
by: phpCodeHead | last post by:
I know that this sounds like something overly complex - because it is. However, if I can keep the user interface the way it is, my users will be ultra happy! That is the goal... In general, this...
8
by: =?Utf-8?B?QkxVRVNUQVI=?= | last post by:
HELLO, I AM A NEW BII TO ASP,AND I NEED HELP ON THIS ISSUE. I HAVE A .ASP FORM WHICH IS ALREADY BUILT WITH 5 QUESTIONS AND 5 TEXTAREAS RESPECTIVELY.THESE 5 QUESTIONS ARE NOT FIX,THERE WILL BE...
5
aas4mis
by: aas4mis | last post by:
I haven't had much luck with specific controls, their properties and loops in the past. I thought I would share this tidbit of code, feel free to modify/modularize in any way to suit your needs. This...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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...

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.