I am receiving this error:
Object doesn't support this property or method: 'frm1.submit'
Here is a copy of my code:
<html>
<head>
<script language="vbscript">
dim frm1
sub window_OnLoad
set frm1 = document.form1
end sub
sub updateTrading_OnClick
'check if year is numeric
set ChkYear = frm1.YearDate1
if chkYear <> "" then
if not IsFieldNumeric(ChkYear) then
exit sub
end if
end if
'submit the form
frm1.submit
end sub
function IsFieldNumeric(field)
if not isnumeric(field.value) then
alert "Year field must be numeric"
field.focus
IsFieldNumeric = false
else
IsFieldNumeric = true
end if
end function
</script>
</head>
<form action="TradingPrivU.asp" method="POST" id="form1" name="form1">
<input name=YearDate1 size=4 maxlength=4 type=text>
<INPUT type="button" name="updateTrading" value="Update">
I receive this error when I click the button. The error happens when it is trying to submit the form to the server. The wierd thing about this is that I get a similar error when I use JavaScript. It does not like to submit! Can you please help me? Any help would be gratly appreciated.
Object doesn't support this property or method: 'frm1.submit'
Here is a copy of my code:
<html>
<head>
<script language="vbscript">
dim frm1
sub window_OnLoad
set frm1 = document.form1
end sub
sub updateTrading_OnClick
'check if year is numeric
set ChkYear = frm1.YearDate1
if chkYear <> "" then
if not IsFieldNumeric(ChkYear) then
exit sub
end if
end if
'submit the form
frm1.submit
end sub
function IsFieldNumeric(field)
if not isnumeric(field.value) then
alert "Year field must be numeric"
field.focus
IsFieldNumeric = false
else
IsFieldNumeric = true
end if
end function
</script>
</head>
<form action="TradingPrivU.asp" method="POST" id="form1" name="form1">
<input name=YearDate1 size=4 maxlength=4 type=text>
<INPUT type="button" name="updateTrading" value="Update">
I receive this error when I click the button. The error happens when it is trying to submit the form to the server. The wierd thing about this is that I get a similar error when I use JavaScript. It does not like to submit! Can you please help me? Any help would be gratly appreciated.