473,387 Members | 3,821 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.

variable part of a variable

Hi,

i have a site with many textareas which got numbered names (answer1,
answer2, answer3). beside each textarea is a link, calling the
javascript-function putText(). i give the number of the textarea with
the call: p.e. putText(1)

in the function putText(textarea) i want to change now
dokument.myform.answerX.value
the X behind answer should be the number of the textarea, given to the
function with the call

sorry, about my english ;-)

markus

Jul 20 '05 #1
1 979
On Sat, 17 Jan 2004 18:21:24 +0100, Markus Schdrunz <ma*******@yahoo.de>
wrote:
i have a site with many textareas which got numbered names (answer1,
answer2, answer3). beside each textarea is a link, calling the
javascript-function putText(). i give the number of the textarea with
the call: p.e. putText(1)

in the function putText(textarea) i want to change now
dokument.myform.answerX.value
the X behind answer should be the number of the textarea, given to the
function with the call


Try:

function putText( taIndex ) {
document.forms['form_name'].elements['answer' + taIndex].value
= 'Whatever should be assigned to the textarea';
}

where the argument, taIndex, is number of the textarea (that is, 1 in
'answer1', etc), and replacing the form name (form_name, above) and new
value as appropriate.

Hope that helps,
Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #2

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

Similar topics

2
by: Marc | last post by:
Hi all, I was using Tkinter.IntVar() to store values from a large list of parts that I pulled from a list. This is the code to initialize the instances: def initVariables(self): self.e =...
83
by: Alexander Zatvornitskiy | last post by:
Hello All! I'am novice in python, and I find one very bad thing (from my point of view) in language. There is no keyword or syntax to declare variable, like 'var' in Pascal, or special syntax in...
2
by: Peter Jenny | last post by:
Hi NG How do I have to use a VARCHAR2 variable in a where clause. I could not find an example. PART_NR VARCHAR2(20); myPartId NUMBER()20; PART_NR := '101 189'; select part_id into...
8
by: Jack | last post by:
Hi, I got a asp page where a variable BudgetTotal is calculated as below: BudgetTotal = (rstemp.Fields("FedBudget") + rstemp.Fields("StateBudget") + rstemp.Fields("LocalBudget")) Initially,...
8
by: Dennis Marks | last post by:
In the following function: function showMenu(theMenu, theAction) { if (document.getElementById) {document.getElementById(theMenu).style.visibility = theAction;} else {if (document.layers)...
3
by: Anders Borum | last post by:
Hello! I've come across a strange error that occurs, when you try to return a nodelist from a variable with a choose/where/otherwise statement. I'm not quite sure whether it's a bug or simply...
3
by: Mark Bergman | last post by:
We have inherited a script which runs rsh (remote shell), taking parameters from a variable, and if attempting to run a multi-word command remotely, we get an error! See the example below which...
2
by: simon | last post by:
hello, what i'm looking to do is store the path of the app on a the server for reuse in the site. my thoughts so far are... -make a key in the web.config file -retrieve the value in globals.asax...
19
by: Hapa | last post by:
Does only reading (never writing) of a variable need thread synchronisation? Thanks for help? PS. Anybody knows a Visual C++ news group?
109
by: bonneylake | last post by:
Hey Everyone, Well i am having a problem outputting for my report and hoping someone can explain what i am doing wrong. What the report is about is comparing my company's part price's to d and...
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
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,...
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.