java - VBA fill webpage textbox -


i'm trying fill textbox getelementbyclassname().value doesn't work. works if use innertext not going since hard codes text. how can address element can pass text it?

<div class="form-field-bottom-field-css no-form-field-mandatory-sign-css"> <span dojoattachevent="onmouseover:onmouseover, onclick:onclick, onmouseout:onmouseout" class="freedom-base-mixin-css dijitvalidationtextbox" widgetid="2a14bad3-825d-4956-8bf8-eda9a55104eaf_age-widget">     <input dojoattachpoint="textbox,focusnode,_aroundnode" dojoattachevent="onblur:onblur,onfocus:onfocus,onkeyup:onkeyup" id="2a14bad3-825d-4956-8bf8-eda9a55104eaf_age-widget" name="" class="dijitreset dijittextbox notdojodndhandle" type="text" tabindex="0" aria-label="number" value="" role="textbox" style="max-width: 7.5em; width: 90%;"><input type="hidden"><span dojoattachevent="onkeypress:onkeypressiconnode,onkeyup:onkeyupiconnode" dojoattachpoint="iconnode" class="notdojodndhandle " style="vertical-align: middle; cursor: pointer; display: none;" tabindex="0" id="2a14bad3-825d-4956-8bf8-eda9a55104eaf_age-widget-iconnode" aria-label="number">             <span class="a11y-text" style="cursor:pointer; display:none">&amp;</span></span>     <div dojoattachpoint="invaliddiv" style="padding-top:2px;display:none;">         <span class="invalidicon"></span>         <span dojoattachpoint="invalidspan" role="alert" class="freedominvalid lfformfielderror"></span>     </div> </span> </div> 

vba:

dim intexpl object set intexpl = createobject("internetexplorer.application") intexpl       .navigate "url"       .visible = true       until intexpl.readystate = 4 loop .document.getelementsbyclassname("lotusbtn")(0).click if application.wait(now + timevalue("0:00:5")) .document.getelementsbyclassname("form-field-bottom-field-css no-form-field-mandatory-sign-css")(0).value = "1" end if end end sub 

found out how works, referencing wrong class .document.getelementsbyclassname("dijitreset dijittextbox notdojodndhandle")(0).innertext = "1"


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -