Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
This versus document.forms
Message
Information générale
Forum:
Internet
Catégorie:
Javascript
Divers
Thread ID:
00529433
Message ID:
00529506
Vues:
10
The syntax is usually:
action="whatever.asp" onsubmit="return go(this)"
>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?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform