TMSFNCWebBrowser Form with Input

I have to access a Secure Email site to retrieve some data. I have a secure link that is emailed to me as downloadable HTML. I can load the HTML from the file into the TMSFNCWebBrowser. I neet to deal with two inputs:

  1. input name="key1" id="passwordInput1" autocomplete="off" type="password"
  2. input type="submit" "id="text_i18n.authframe.safr.button.openonline" value="Open Online" name="openButton"

Is it possible for me to fill in the password and submit the form from my program?

Thanks

You can fill in the fields with JavaScript:

TMSFNCWebBrowser1.ExecuteJavaScript('document.getElementById("passwordInput1").value="MyPassword"');

I tried that and it did not work. It works on a normal webpage but not here. The webpage is very complex with the inputs being in tables within a frame.

<table id="outerTable"
<tbody>
<tr>
<td id="iframelocation">
<iframe id="authFrame"
#document
>html>
<body>
<form>
<table class="mainWIndow">
<tbody>
<tr>
<td id="heightControl"
<table>
<tbody>
<tr>
  <td>
  <table id=borderTable">
  <tbody>
    <tr>
      <td id=passwordEntry1">
      <p>
      <input size="20" maxlength="127" name="key1" id="passwordInput1" placeholder="Secure Email Encryption Service Password" title="Enter your password here" autocomplete="off" type="password" style="width: 100%;">
       </input>

The button is also in a table row of this complex structure. I can click the button on a normal page using document.querySelector("input[type=submit]").click() But I can't get it to work here.

I am emailed an HTML file which the program opens in the browser. The downloaded HTML then accesses the secure webpage where I need to enter the password and press the button. I can manually enter the password and press the button but I can't get the program to do it. Once I have submitted the form, I can access the data I need from the inner HTML of the returned document.

The entire process is non-interactive so I can try getting it to work with an idHTTP. But for more secure operations, it is easier to just open a TMS web browser to get the data. I also tried using Delphi's TEdgeBrowser and it has the same issue.

What do you suggest?

Thanks

If it's in an iFrame, you will need to get the iFrame first and then use the document.getElementById on the iframe window:

document.getElementById('authFrame').contentWindow.document.getElementById('passwordInput1')