I have a webpage that I am extracting data from. I can do everything fine with VBA apart from clicking on an image element which then submits a form and a popup with data is created.
One of the attributes in the image element is called "productguid" and has a string value =
"a12-545".
The HTML code of the form looks like this BEFORE I click on the image element with my mouse.
<form id="GetProductQuantitiesForAccessibleBranches" action="GetProductQuantitiesForAccessibleBranches" method="post">
<input type="hidden" name="ProductGuid" value="">
</form>
This is the HTML code AFTER I manually click on it with the mouse:
<form id="GetProductQuantitiesForAccessibleBranches" action="GetProductQuantitiesForAccessibleBranches" method="post">
<input type="hidden" name="ProductGuid" value="a12-545">
</form>
Based on this I assumed that the productguid value from the image element gets passed onto the form before it is submitted. Here is what my VBA code looks like this:
'Change the input element value
ie.Document.getElementById("GetProductQuantitiesForAccessibleBranches").all.item(0).value = "a12-545"
'Submit the form
ie.Document.getElementyId("GetProductQuantitiesForAccessibleBranches").Submit
According to the Locals window, all the Javascript events are Null
. Both lines of code run without any errors but the webpage does not update. Am I missing something here?
I have also tried just clicking the image element with the .Click
method, but that doesn't do anything either.
The webpage is password protected so I cannot post the URL publicly.
UPDATE:
Here is the HTML in the tag that normally is clicked manually which then submits the form. Perhaps there is something in here that I can use?
<img alt="View Quantities At Other Locations" src="/WebOrder/Images/CheckQtys.gif"
title="View Quantities At Other Locations" class="popup"
popupdirection="upperleft" popupwidth="380"
popupcontent="#ProductQuantitiesForAccessibleBranches"
onbeforepopupcreate="onBeforePopupCreate_GetProductQuantitiesForAccessibleBranches(this)"
popupajaxformid="GetProductQuantitiesForAccessibleBranches"
onbeforepopupajaxpost="onBeforePopupAjaxPost_GetProductQuantitiesForAccessibleBranches(this)"
oncompletepopupajaxpost="onCompletePopupAjaxPost_GetProductQuantitiesForAccessibleBranches(this)"
productguid="a12-545"
displayitem="33902"
brandguid="00000000-0000-0000-0000-000000000000"
brandname="" brandsku="">