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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type mismatch error

Status
Not open for further replies.

lucyc

Programmer
Mar 1, 2002
62
US
I have an include file called SectionII.vbs which contains a sub called optTypeOfScreen_SetVisibility.

Here is the code:
<SCRIPT language=&quot;VBSCRIPT&quot;>
Sub optTypeOfScreen_SetVisibility(strFacilityType)
If strFacilityType=&quot;T&quot; then
if Document.Forms(0).htxtTypeOfScreen.Value=&quot;M&quot; then
getElementById(&quot;divFacilityDefinedFields&quot;).Style.Visibility=&quot;Hidden&quot;
End if

if Document.Forms(0).htxtTypeOfScreen.Value=&quot;B&quot; then
getElementById(&quot;divFacilityDefinedFields&quot;).Style.Visibility=&quot;Visible&quot;
end if
else
getElementById(&quot;divFacilityDefinedFields&quot;).Style.Visibility=&quot;Visible&quot; end if
End Sub
</SCRIPT>

On the asp, I have the following

<!--#include file=&quot;SectionII.vbs&quot;-->
.
.
.
.
Response.Write &quot;<DIV ID=&quot;&quot;divFacilityDefinedFields&quot;&quot; Style=&quot;&quot;visibility:Hidden&quot;&quot; Width=&quot; & SRFORM_TABLE_SPAN_WIDTH &&quot;>&quot;

I am getting -- type mismatch:&quot;getElementById&quot;
What is wrong?? Thanks.
 
I tried that and get object required error again.
 
works fine for me when i add &quot;document.&quot;:

<SCRIPT language=&quot;VBSCRIPT&quot;>
Sub optTypeOfScreen_SetVisibility(strFacilityType)
If strFacilityType=&quot;T&quot; then
if Document.Forms(0).htxtTypeOfScreen.Value=&quot;M&quot; then
document.getElementById(&quot;divFacilityDefinedFields&quot;).Style.Visibility=&quot;Hidden&quot;
End if

if Document.Forms(0).htxtTypeOfScreen.Value=&quot;B&quot; then
document.getElementById(&quot;divFacilityDefinedFields&quot;).Style.Visibility=&quot;Visible&quot;
end if
else
document.getElementById(&quot;divFacilityDefinedFields&quot;).Style.Visibility=&quot;Visible&quot;
end if
End Sub
</SCRIPT>


=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top