I'm filling out a web form with values from a spreadsheet. The form fills out fine, but there is some JavaScript field validation that takes place and since my code is filling in the text box fields without the validation, it is seeing my fields as empty. Here is a snippet of my VBA code.
Set objCollection = wd.document.getElementsByTagName("input")
i = 0
While i < objCollection.Length
'Name
If objCollection(i).Name = "Y__0__Cctl1_ctl8_ctl2_6_ctl4__X" Then
objCollection(i).Value = Sheets("Main").Range("b4") ' "Hello World"
End If
I've narrowed down the onkeypress Javascript function but I'm not sure how to correctly call it in VBA with the appropriate variables. Here is another snippet.
<input name="Y__0__Cctl1_ctl8_ctl2_6_ctl4__X" title="" class="DefaultTextBox DefaultTextBoxMandatory" id="Y__0__Cctl1_ctl8_ctl2_6_ctl4__X" onkeypress="return aeweb_BlurAndCallAssoc( this, 'Y__0__Cctl1_ctl8_ctl2_6_ctl4__X', event);" onblur="aechg(this, event);" type="text" value="Hello World" cursor="01Q0Q0Q1" lastvalue="Hello World" ismandatory="true">
Any help would be greatly appreciated.
Thanks!