hi I'm making a macro in excel that loads up internet explorer and fills out a form. I'm able to do all of that but i have a hard time to trigger a javascript onchange event that is triggered when a user manuallay types a number in the textbox and clicks outside the box.
here is my code for that text box
' Inserts unit sales price
IEdoc.All("ctl0 0$ContentPlaceH olderMain$uxFtc $uxUnitSalesPri ce").Value = Cells(i, 10)
and here is the source piece from the website that shows the textbox and the onchange,
<tr><td>
<span id="ctl00_Conte ntPlaceHolderMa in_uxFtc_uxUnit SalesPriceLabel ">Unit Sales Price:</span>
</td><td>
<input name="ctl00$Con tentPlaceHolder Main$uxFtc$uxUn itSalesPrice" type="text" onchange="javas cript:setTimeou t('__doPostBack (\'ctl00$Conten tPlaceHolderMai n$uxFtc$uxUnitS alesPrice\',\'\ ')', 0)" onkeypress="if (WebForm_TextBo xKeyHandler(eve nt) == false) return false;" id="ctl00_Conte ntPlaceHolderMa in_uxFtc_uxUnit SalesPrice" onfocus="StoreF ocusElementName ()" />
<span id="ctl00_Conte ntPlaceHolderMa in_uxFtc_uxUnit SalesPriceCurre ncy">USD</span>
</td></tr>
I'm a begginer so this could be very simple.
Any help would be much appreciated
Thanks
here is my code for that text box
' Inserts unit sales price
IEdoc.All("ctl0 0$ContentPlaceH olderMain$uxFtc $uxUnitSalesPri ce").Value = Cells(i, 10)
and here is the source piece from the website that shows the textbox and the onchange,
<tr><td>
<span id="ctl00_Conte ntPlaceHolderMa in_uxFtc_uxUnit SalesPriceLabel ">Unit Sales Price:</span>
</td><td>
<input name="ctl00$Con tentPlaceHolder Main$uxFtc$uxUn itSalesPrice" type="text" onchange="javas cript:setTimeou t('__doPostBack (\'ctl00$Conten tPlaceHolderMai n$uxFtc$uxUnitS alesPrice\',\'\ ')', 0)" onkeypress="if (WebForm_TextBo xKeyHandler(eve nt) == false) return false;" id="ctl00_Conte ntPlaceHolderMa in_uxFtc_uxUnit SalesPrice" onfocus="StoreF ocusElementName ()" />
<span id="ctl00_Conte ntPlaceHolderMa in_uxFtc_uxUnit SalesPriceCurre ncy">USD</span>
</td></tr>
I'm a begginer so this could be very simple.
Any help would be much appreciated
Thanks
Comment