473,485 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Don't see the error here

<script language="JavaScript">
function copyComment(fieldNameVal,fieldTextVal){
eval("document.Forms[0]." + fieldNameVal + ".value =" + fieldTextVal)
}
</Script>

Jul 23 '05 #1
3 1045

eval("document.F<------ try an 'f'

Never mind, junk the whole thing....

document.forms[0].elements[fieldNameVal].value = fieldTextVal;
*** Sent via Developersdex http://www.developersdex.com ***
Jul 23 '05 #2
Lee
Fetty said:

<script language="JavaScript">
function copyComment(fieldNameVal,fieldTextVal){
eval("document.Forms[0]." + fieldNameVal + ".value =" + fieldTextVal)
}
</Script>

1. language="Javascript" is deprecated.
2. Don't use eval() to reference form fields.
3. There is no document.Forms attribute. It's "document.forms".
Try:

<script type="text/javascript">
function copyComment(fieldNameVal,fieldTextVal){
document.forms[0].elements[fieldNameVal].value = fieldTextVal;
}
</script>

Jul 23 '05 #3
"Fetty" <da***@helixpoint.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
<script language="JavaScript">
function copyComment(fieldNameVal,fieldTextVal){
eval("document.Forms[0]." + fieldNameVal + ".value =" + fieldTextVal)
}
</Script>


script tag language attribute deprecated, type attribute required.
eval() not required. JavaScript is case-sensitive and the forms
collection of the document object is lowercase.

<script type="text/javascript">
function copyComment(fieldNameVal, fieldTextVal)
{
document.forms[0].elements[fieldNameVal].value = fieldTextVal;
}
</script>

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #4

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

Similar topics

3
1646
by: Michael | last post by:
I have broken PythonWin and I don't know how or why. It worked great until recently. I have installed / removed several apps since it worked last. I could have a virus unknown to my antivirus...
3
1952
by: Jacques Koorts | last post by:
Hi I really don't know anymore how to solve this problem. I bought .NET thinking i can debug my way out of it but still no cigar. This very simple piece of code does not work: Now here some...
16
1960
by: G Patel | last post by:
Hi, If I want to call functions that don't return int without declaring them, will there be any harm? I only want to assign the function(return value) to the type that it returns, so I don't...
0
17722
by: Nashat Wanly | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaskdr/html/askgui06032003.asp Don't Lock Type Objects! Why Lock(typeof(ClassName)) or SyncLock GetType(ClassName) Is Bad Rico...
2
1389
by: Tom wilson | last post by:
This is a huge problem. I'm going insane. I've tried to solve this elsewhere and no one can suggest how to make this work. To me, this should be a very basic thing to do. I have an asp.net...
10
2696
by: Jeff | last post by:
Ok gang. Here is one I haven't seen before. I have a page that creates an image with text put on it using persists. he text is based on a variable. It has been working perfectly fine until today....
13
4877
by: rdemyan via AccessMonster.com | last post by:
My front-end code manually links to the backend file. I was wondering what stops Access from linking to the system tables in the backend file. Is it just by virtue that they are hidden? This...
8
1342
by: Simon Willison | last post by:
Hi all, I have an API design question. I'm writing a function that can either succeed or fail. Most of the time the code calling the function won't care about the reason for the failure, but...
11
5025
by: Jan | last post by:
Hi: Here's a problem I've had for a long time. The client is really running out of patience, and I have no answers. Access2003, front- and back-end. Single form with 4 subforms (each...
5
13689
by: workingstiff19 | last post by:
I just want people to click on a link to download a file. I've done it before, but this is a new computer and I must be missing something. (Possibly an Apache configuration setting?) Here is...
0
7090
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
6960
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
7116
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
5418
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
4857
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
3058
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
3063
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1376
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
595
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.