Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
This versus document.forms
Message
From
11/07/2001 16:38:48
 
 
To
All
General information
Forum:
Internet
Category:
Javascript
Title:
This versus document.forms
Miscellaneous
Thread ID:
00529433
Message ID:
00529433
Views:
43
From a form action, I am calling a javascript function with the form object. However, the this syntax doesn't seem to work. I have to pass document.forms instead.

This doesn't work.
...FORM NAME=Sujet ACTION=javascript:Go(this)

< SCRIPT>
function Go(toForm)
{
   alert(toForm.MyField.value);
}
This works.
...FORM NAME=Sujet ACTION=javascript:Go(document.forms.Sujet)

< SCRIPT>
function Go(toForm)
{
   alert(toForm.MyField.value);
}
Why?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform