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

Append javascript arguments

Hi,

I just want to append the arguments from the function in javascript to
the variables as
function a()
{
var temp=arguments[0];

var t=document.form[0]."+temp+".value

}
But the above thing is not working , how can i append the arguments in
the variables.
Thanks in Advance,

Apr 18 '07 #1
3 7721
Meendar wrote:
Hi,

I just want to append the arguments from the function in javascript to
the variables as
function a()
{
var temp=arguments[0];

var t=document.form[0]."+temp+".value

}
function a(){
t=document.forms[0].elements[arguments[0]].value
}
Note "forms[0]" (plural), and using "var" in this context makes no sense.
Mick
>

But the above thing is not working , how can i append the arguments in
the variables.
Thanks in Advance,
Apr 18 '07 #2
"Meendar" <as****************@gmail.comwrote in message
news:11*********************@b75g2000hsg.googlegro ups.com...
Hi,

I just want to append the arguments from the function in javascript to
the variables as
function a()
{
var temp=arguments[0];

var t=document.form[0]."+temp+".value
var t = document.forms[0][temp].value;
}

But the above thing is not working , how can i append the arguments in
the variables.
That function will only work if it is passed a string that coincides with the name of a
FORM element.

For example:

<input type="text" name="text1" onblur="a(this.name);" />

-Lost
Apr 20 '07 #3
Michael White wrote:
Meendar wrote:
>Hi,

I just want to append the arguments from the function in javascript to
the variables as
function a()
{
var temp=arguments[0];

var t=document.form[0]."+temp+".value

}

function a(){
t=document.forms[0].elements[arguments[0]].value
}
Note "forms[0]" (plural), and using "var" in this context makes no sense.
Why exactly is using the var keyword in this context nonsensical?

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Apr 24 '07 #4

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

Similar topics

11
by: Derek Richards | last post by:
In VbScript, when you have a method, you do ..Method A, B, C, D. If you would take some default values, you do ..Method A,,,D My question is that how you can do this in JavaScript ..Method(???)...
2
by: adamsroy | last post by:
Hi I'm trying to append an already existent text file, simple enough, but it doesn't seem to be working, here's my code <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%> <% var stringToWrite =...
3
by: barry | last post by:
I have the following: function(NAMED) { sString.Append("document.forms.NAMED.style.visibility = 'hidden'") } and would like to convert the NAMED into the object it represents - for example in...
26
by: John Salerno | last post by:
If I want to create a list of the form (where each item is repeated twice after the first one), how might I do that most efficiently? Right now I have this: series = for x in range(10): ...
7
by: andrewfsears | last post by:
I have a question: I was wondering if it is possible to simulate the multiple constructors, like in Java (yes, I know that the languages are completely different)? Let's say that I have a class...
14
by: rabbitrun | last post by:
Hi Everyone, I work for a financial company. I am planning to give a presentation to rest of the development team (15 people) here on moving server side logic to client-side javascript for an...
13
by: Walton | last post by:
I'm wondering if anyone knows or knows where to find a collection of javascript "brain teasers" for lack of a better description. Companies use these types of tests for programmers all the time...
4
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
1
by: KRISHNA PRAVI | last post by:
the error is "runtime error object expected" here is the code....................................................................................... <script language="javascript"...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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
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,...
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.