[RESOLVED] Submitting form issue
I'm trying to submit a form within the Webbrowser control but I can't find the 'name' or 'id' of the submit button. I can insert the Stock Code into the 'securityCode' filed but can't sumbit the form :confused:
Below is the form and what I've tried without any luck.
HTML Code:
WB1.Document.getElementById("DetailedQuoteForm").submit
and
WB1.Document.getElementById("DetailedQuoteForm").Click
HTML Code:
<form name="DetailedQuoteForm" method="post" action="/do/secure/detailedQuote">
<input type="hidden" name="submit" value="true" />
<table class="selector-outer" summary="ASX Codes">
<tr>
<td>
<table class="selector-inner" summary="ASX Codes">
<tr>
<td>
<label for="inputasxcode">ASX Codes:</label>
</td>
<td>
<input type="text" name="securityCode" maxlength="6" size="10" value="" id="inputasxcode" />
</td>
<td>
<span class="codesearch">(<a href="companyInfoSearch?url=detailedQuote_submit=true">Search for ASX Code</a>)</span>
</td>
<td>
<input type="submit" value="Refresh" class="button" alt="Refresh" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
Re: Submitting form issue
Lintz, try
Code:
Dim HTML As HTMLDocument
Dim sb As HTMLButtonElement
Set HTML = wb1.Document
Set sb = HTML.getElementsByName("submit").Item
sb.Click
Re: Submitting form issue
I get an error message - "user-defined type not defined" with the below line highlighted.
Code:
Dim HTML As HTMLDocument
Re: Submitting form issue
You need to add the referrence to "Microsoft HTML Object Library " under project > reference . please try.
Re: Submitting form issue
Added reference and goes through your code without error but after 'sb.click' nothing happens. It's like the button hasn't been pressed? :confused:
Re: Submitting form issue
lintz, is this the button ?
<input type="hidden" name="submit" value="true" />
Is really the button is hidden ?
Re: Submitting form issue
Got it to work :D
vb Code:
Dim HTML As HTMLDocument
Dim sb As HTMLFormElement
Set HTML = WB1.Document
Set sb = HTML.Forms("DetailedQuoteForm", 0)
sb.submit
Re: [RESOLVED] Submitting form issue