Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi guys, I'm getting a type mismat

Status
Not open for further replies.

stupy1

Programmer
Feb 22, 2002
10
US
Hi guys,
I'm getting a type mismatch error with the following function:

function checksubmit()

if doc.Total_Method_2004.value <> 100 or doc.Total_Method_2005.value <> 100 or doc.Total_Method_2006.value <> 100 then
msgbox &quot;Method distributions must sum to 100%&quot;
checksubmit = False
else
if doc.Total_all.value <> doc.Target_all.value then
msgbox &quot;All year totals must equal their target totals.&quot;
checksubmit = False
else
checksubmit = True
end if
end if

end function

It's being called here:
<form name=&quot;methods&quot; method=&quot;post&quot; action=&quot;categories.asp&quot; onsubmit=&quot;return checksubmit()&quot;>
I'm able to get into the function and the first alert box &quot;Method Distributions....&quot; but then the error Type mismatch: 'return' 
I have no clue what's going on and I have rewritten the function in vbscript and I get the same error.  A varation of this function works on all my other pages so there might be a conflict somewhere within this page.
thanks,
stupy
 
try this:

onsubmit=&quot;return (checksubmit())&quot;

hope that works
mb
:)
&quot;Where's the Ka-Boom? There's supposed to be an Earth-shattering Ka-Boom!&quot;
Marvin the Martian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top