Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
This versus document.forms
Message
De
11/07/2001 16:38:48
 
 
À
Tous
Information générale
Forum:
Internet
Catégorie:
Javascript
Titre:
This versus document.forms
Divers
Thread ID:
00529433
Message ID:
00529433
Vues:
44
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform