Okay, I've read and read and tried everything I can think of but I still cannot get this to work. I need to execute VBScript from a javascript function. I've read that javascript and VBScript cannot talk to each other and found a workaround to have the VBScript execute with the onChange event in a hidden text field and then change the value of that field with javascript. I cannot get that to work though and have thus far not been able to find any other workarounds. Please help!
CODE
<script type='text/javascript'>
function CreateX()
{
try{
//document.WebCamX1.CreateX();
if(IpAddress == 0)
{
document.WebCamX1.IpAddress= document.location;
}
else
{
document.WebCamX1.IpAddress= IpAddress;
}
document.WebCamX1.CommandPort = CommandPort;
document.WebCamX1.DataPort = DataPort;
document.WebCamX1.AudioDataPort = AudioPort;
document.WebCamX1.AutoSetCamera = 1;
document.WebCamX1.SetInfo(125,1,0,"","");
document.WebCamX1.SetInfo(129,1,0,"","");
document.WebCamX1.SetUpdateInfo(100, "WebCam", 0, "", 8200, 0,0);
LivexExist=true;
}catch(e){
//alert("Test");
document.form1.VBExec.value = "1";
LivexExist=false;
}
}
</script>
<script for="VBExec" event="onChange" Language="VBScript">
MsgBox "Test"
</script>
</head>
<body>
<form name="form1" method="POST">
<input type="hidden" id="IDKey" name="IDKey" value="IDENTIFY_KEY" />
<input type="hidden" id="VBExec" name="VBExec" value="0" />
</form>
This post has been edited by bstonehill: 17 Sep, 2008 - 10:08 AM