Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
This versus document.forms
Message
 
To
11/07/2001 16:38:48
General information
Forum:
Internet
Category:
Javascript
Miscellaneous
Thread ID:
00529433
Message ID:
00529449
Views:
11
TO state the obvious, the 'this' is not referring to your form name. I think the 'this' is referring to the global object...

>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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform