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

NBScript and Javascript in the same HTA Application not working...

Status
Not open for further replies.

cbsarge

IS-IT--Management
Jun 20, 2001
219
US
I have the following HTA application. This is a small version of a larger one I'de like to use to wrap a bunch of VBscripts for AD, hardware, processes, etc. I want to be able to use checkboxes to expand areas of the HTA when I want to use those types of tools.
Code:
<html>
<head>
<html>
<head>
<title>Useful Tools</title>
<HTA:APPLICATION 
     APPLICATIONNAME="Useful Tools"
     SCROLL="no"
     SINGLEINSTANCE="no"
     WINDOWSTATE="normal"
     VERSION="1.0"
/>
<script language="JScript">
function HidePart(d) { document.getElementById(d).style.display = "none";  }
function ShowPart(d) { document.getElementById(d).style.display = "block"; }
function CheckboxChecked(b,d)
{
   if(b) { ShowPart(d); }
   else  { HidePart(d); }
}
</script>
<script language="VBScript">
    Sub Window_onLoad
        window.resizeTo 1024,900
    End Sub 
</script>
</head>
<body>
<h1>Brian's Useful Tools</h1>
<form>
<p>
<input 
   type="checkbox" name="mycheckbox" value="yes" onclick="CheckboxChecked(this.checked,'checkboxdiv4')">
Check this box if you are married.
</p>
<div id="checkboxdiv4" style="display:none">
<p>
<input type="button" value="Process Information" name="run_button"  onClick="ProcessInfo"><p>
</p>
</div>
</form>
</body>
</html>
The expanding by a checkbox works but, the script causes an error. When I run this same script in an HTA that doesn't use a Javascript (for the expanding checkbox) it works fine.

Can anyone tell me what's wrong?

Thanks!

[!]The AutoSavers![/!] [2thumbsup]
 
I don't get an error with the above code. (Other than 'ProcessInfo is undefined').

Even the mixed VBScript / Jscript seems to work as written (in IE 6 on XP).

At some point, you may want to start using doctypes and proper, modern syntax (i.e <script type="text/JavaScript">), but I cannot reproduce your problem with the code given.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top