Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
This versus document.forms
Message
General information
Forum:
Internet
Category:
Javascript
Miscellaneous
Thread ID:
00529433
Message ID:
00529506
Views:
9
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?
Previous
Reply
Map
View

Click here to load this message in the networking platform