corvenus
05-27-2004, 04:54 PM
Hi everyone,
I'm trying to execute a javascript function in the following manner:
<form name="someform" action="somepage" method="post" onsubmit="return enableChk(this.form);">
The function is:
function enableChk(form1){
alert(form1)
}
The function gets called well, but the alert gives "undefined", so I'm guessing that you can't use "this.form" inside a <form> tag. Can anyone confirm this?
I could hardcode the form name inside the function but i want it to be re-usable, so afaik "this.form" is the only way to go. If all else fails i'll use the function on a submit button instead, which should work (in theory), but i'd like to be able to use it in the <form> tag.
Thanks for any input! (pun intended :) )
I'm trying to execute a javascript function in the following manner:
<form name="someform" action="somepage" method="post" onsubmit="return enableChk(this.form);">
The function is:
function enableChk(form1){
alert(form1)
}
The function gets called well, but the alert gives "undefined", so I'm guessing that you can't use "this.form" inside a <form> tag. Can anyone confirm this?
I could hardcode the form name inside the function but i want it to be re-usable, so afaik "this.form" is the only way to go. If all else fails i'll use the function on a submit button instead, which should work (in theory), but i'd like to be able to use it in the <form> tag.
Thanks for any input! (pun intended :) )