wackywoo105
Registered User.
- Local time
- Yesterday, 19:24
- Joined
- Mar 14, 2014
- Messages
- 203
Can anyone help with how to click this button using IE.document?
document.getElementsByTagName("button")[0].innerText
document.getElementsByTagName("button")(1234).click
, where 1234 is the number you found.That modal is part of the document, when it shows, it's because its hidden attribute was removed, but you can input data there. Test if you can trigger the AddNewAddress() function by simply typing that in the console.I can still insert data
function AddNewAddress(){if(required()){if(CheckValidPostCode('Postcode')){var finalAddresss=GetAddressModaldata();var targetID=$('#targetControlID').val();$("#"+targetID).html(finalAddresss);$('#Address').val($('#txtAddress').text()).trigger('change');$('#performerdeclaration_sightAddress').val($('#txtAddress').text());$('#PatientDeclaration_Address').val($('#txtAddress').text()).trigger('change');$('#VenueMaintainance_Address').val($('#txtAddress').text());var arrayInput=document.getElementById('AddressModal').getElementsByClassName("required");jQuery.each(arrayInput,function(){$('span[data-valmsg-for="'+this.id+'"]').addClass('hide');$("#isPresent").hide();$("#isPostcodeValid").hide();});$('#AddressModal').modal('hide');} ...
yes. that when I noticed it triggered the function on the hidden box.Did you call it using the parentheses at the end?
IE.Document.parentWindow.execScript "AddNewAddress()"
See what changes when it's closed and when it's open.Is there any way to make the page think the window has been previously opened?
<button class="btn btn-info ipad-Address-btn-margin" type="button" data-toggle="modal" data-target="#AddressModal" data-book-id="txtAddress">Please enter the address manually</button>
The part that saysthis is the button that opens the pop up address box
Code:<button class="btn btn-info ipad-Address-btn-margin" type="button" data-toggle="modal" data-target="#AddressModal" data-book-id="txtAddress">Please enter the address manually</button>
I'm not really sure how to find out what changes when it is opened and closed?
TBF just opening and closing it straight away doesn't really matter. It's not the cleanest, and I would like to understand what is going on, but as long as it works that's the main thing.
data-target="#AddressModal"
means there's an element in your document with Id "AddressModal". It's probably a div tag that's hidden at first. When you click the button, this box becomes visible, likely because it changes or removes its hidden attribute.