(Solved) – VBA HTML Add Input Element to Span

  • by

I am trying to work with an internet explorer session using VBA.

The HTML of the website adds input check boxes using some background procedure when a div element is clicked, rather than a native input checkbox. When fired, the background process adds an input element to a span at the bottom of a form. Because I cannot directly interact with the psuedo-checkbox div element and get the process to fire using .click, I am trying to add what I know will be the resulting input elements to the span at the bottom of the form.

Example HTML:

span id="checkboxesFor_wt.epm.EPMDocument.defaultSearchView" style="visible"
    input type="checkbox" checked="true" id="search$search$$|search$executeSearch$$|search$search$$VR:wt.epm.EPMDocument:6927561181!*" name="pjl_selPJLsa1__1" value="search$search$$|search$executeSearch$$|search$search$$VR:wt.epm.EPMDocument:6927561181!*"
    input type="checkbox" checked="true" id="search$search$$|search$executeSearch$$|search$search$$VR:wt.epm.EPMDocument:6927577196!*" name="pjl_selPJLsa1__1" value="search$search$$|search$executeSearch$$|search$search$$VR:wt.epm.EPMDocument:6927577196!*"
    input type="checkbox" checked="true" id="search$search$$|search$executeSearch$$|search$search$$VR:wt.epm.EPMDocument:6822696098!*" name="pjl_selPJLsa1__1" value="search$search$$|search$executeSearch$$|search$search$$VR:wt.epm.EPMDocument:6822696098!*"

I believe that I need to use the .appendChild() on the span but I have not been able to make any progress in this aspect. Everything for iterating through the rest of the page and grabbing information needed to set the input element is good to go. I just need to add the input element to the span somehow.

Leave a Reply

Your email address will not be published. Required fields are marked *