Click to See Complete Forum and Search --> : Problem Passing varibles from Form to Function


redcamel
09-28-2005, 04:23 PM
I'm having a problem passing varible name strComp from myform back up to the LaunchComp function. I'm sure it simple but I'm a newbie so please help me out. I will attach my code

redcamel
09-28-2005, 04:24 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" language="JavaScript">

function LaunchComp(strComp)
{
varParam = "/computer=" + strComp
var launcher = new ActiveXObject("Shell.Application");
launcher.ShellExecute("compmgmt.msc", varParam, "", "open", "1");
}
</script>
</head>

<body>



<FORM name=myform >
<p>Computer Name:</p>
<INPUT maxLength=200 size=25 name=strComp>
<INPUT type=reset value=Reset name=Reset>
<INPUT type="button" value="open it" name="open" onclick="return LaunchComp(strComp)" >
</FORM>
</body></html>