Biomek HTML

Has anyone else run into issues returning a variable from an HTML form to the main script? Usually you can do something like this (fyi: this is just a basic HTML to show the problem. Not the one I’m building):

<html>
   <head>
      <script language=JScript>
         function SetVariable() {
         window.external.Volatile.answerNumberOfSamples = document.getElementById("numberofsamples").value;
}
      </script>
   </head>
 <body>

<form>
<div>Enter the Number Of Samples.</div>
 <input type="number" id = "numberofsamples" value = "0">
<br>      
<div>Click OK to close this window.</div>
 <input type="submit" value = "OK" OnClick = SetVariable()>
      
</form>
   </body>
</html>

I can then usually see the value of ‘answerNumberOfSamples’ in my main script and return it to the Biomek software with World.Globals.PropertyChanger.SetGlobals “VariableInMethod”, World.Volatile.answerNumberOfSamples. But it sends a message that the ‘key’ answerNumberOfSamples has not been defined.

Thoughts?