MSHTML to access HTMLElements dynamically created with JavaScript

Apologies if this is the wrong forum!

I am trying to manipulate a web page by using a Twebbrowser and mshtml. In particular, I am trying to access the username and password fields of the following web page: https://partnerinsight.kctrust.co.uk/Login

I can see the username and password on the web page. I can enter my data and submit it using the web page, but when I "view source" to try and find the ids for these fields. whole sections of the web page are not referenced in the source including the username and password inputs and the Login button.

I can see the source for each of these elements if I use "Inspect Elements" on Google Chrome.

I have tried to access these elements using IHTMDocument2 Interface, but it does not find them.

Is there any way I can get at these elements using mshtml or have I got to go about it another way?
0
Mark
2/25/2015 9:37:13 PM
embarcadero.delphi.winsock 1874 articles. 2 followers. Follow

2 Replies
931 Views

Similar Articles

[PageSpeed] 39

Mark wrote:

> I can see the username and password on the web page. I can enter my
> data and submit it using the web page, but when I "view source" to try
> and find the ids for these fields. whole sections of the web page are
> not referenced in the source including the username and password
> inputs and the Login button.

That means they are being created dynamically by scripting after the page 
is loaded.

> I have tried to access these elements using IHTMDocument2 Interface,
> but it does not find them.
>
> Is there any way I can get at these elements using mshtml or have I
> got to go about it another way?

Once the elements have been created by the script, they are accessible via 
the DOM interfaces.  So you are likely not searching for the elements correctly. 
 Please show your actual code.

-- 
Remy Lebeau (TeamB)
0
Remy
2/25/2015 9:56:14 PM
> Once the elements have been created by the script, they are accessible via 
> the DOM interfaces.  So you are likely not searching for the elements correctly. 
>  Please show your actual code.
> 

I was monitoring the documentComplete event, which is too early. I put a short sleep in there and the elements were then accessible. Just need to put some code in to wait for the tags t be loaded.

Many thanks
0
Mark
2/25/2015 11:30:35 PM
Reply:

Similar Artilces:

Accessing dynamically created checkboxes in javascript
Hi  I'm using div.innerhtml to create my tables with data and dates with checkboxes based on the selections and  backend database. I'm dynamically creating my tables and the first column of the table contains the checkboxes created through this innerhtml string. Now i need to check which all checkboxes have been cheked and deduct the values from the summary rows of the tables based on these selections. Any suggestions are greatly appreciated. I do not know how to send this checkboxes array to the javascript function as i'm giving an onClick event for each of these chec...

accessing dynamically created controls in codebehind with javascript
Ok, my page consists almost entirely of dynamically created controls from codebehind.  I need to do some client-side scripting with javascript and I was wondering if it is possible to access those controls from the javascript. If the controls exist on the page (they are not hidden from the code behind) then you can access them with JavaScript.EricPascarello.com | Twitter epascarello | LinkedIn...

Accessing Dynamically created Controls value in JavaScript function.......
Hi,     Can some one plz explain me how can we access dynamically created controls value in our javascript function?I am just adding a html drop down list at run time to a calendar control.and adding some value to it.And i create a javascript function which simply show slected value in an alert... This is Calendar Dayrender event on which i just add a html DropDownList at runtime..... protected void Calendar1_DayRender(object sender, DayRenderEventArgs e) { if (e.Day.Date == Calendar1.SelectedDate) { HtmlSelect ddl = new HtmlSelect(); ddl.Value = "abc"; ddl.Items.Add(...

Please guide
Hi, I am creating dynamic panels and each of these panels have an image and a button. I would like to show a modal popup when the button of the panel is clicked. Contents of popup depend on which button was clicked. I would sincerely appreciate if some one could guide me if this is possible with Ajax and AjaxControltoolkit. Till now I tried to create modalpopupextended dynamically in the click event of button and page fails with an error message that TargetControl could not be found. Please guide. Regards & thanks Kapil    Hi Kapil, Unfortunately, the ModalPopup must h...

how can i access a dynamically created upload ctrl through javascript in default.aspx.cs file?
how can i access a dynamically created upload ctrl through javascript in default.aspx.cs file? default.aspx file <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"><title>Untitled Page</title>       <script language="...

TIMDev JavaScript v2.00.0 JavaScript Editor Created By Delphi
TIMDev JavaScript v2.00.0 Free JavaScript Editor is advanced JavaScript Editor, Validator and Debugger for beginners and professionals. JavaScript developers can easily use the program as Free JavaScript Editor is used for professionally editing JavaScript code and creating animations and other special effects for Web pages using DHTML, CSS and JavaScript. Picture http://www.zupimages.net/up/14/01/i3py.png Download https://www.mediafire.com/?15hl2s58i851woa ...

Dynamic table generation by JavaScript, Accessing row and data of dynamic table in C# code
  <div>   <input id="txtName" type="text"/> <input id="txtAdd" type="text"/> <input id="txtCity" type="text"/>   <input id="btnAdd" type="button" value="Add" onclick="AddClick();" /> <input id="btnRemove" type="button" value="Remove" onclick="RemoveClick(this);"/><br /> <table id="tblInfo" runat="server" style="width: 474px" > </table> </div&g...

Access values dynamically created
hi, i have a placeholder and with the help of ViewState, i dynamically generate a set of dropdown and textbox. i want to be able to pick this information, when the form gets submitted. I have searched for the right solution, but I haven't come across it. say, panel1 .. dd1, dd2, dd3 .... and so on txt1, txt2, txt3 .... and so on I greatly appreciate your help. Thank You Hi, I have reached this far, Dim myHolder As Object = Page.FindControl("plhDocument") Dim myObject As Object For Each myObject In myHolder.Co...

accessing controls created through Javascript
 I have created input controls (text,checkbox,radio,dropdown) dynamically using Javascript createElement().But how can access it in code behind?Thank you. Never Say Die  hi The HtmlInputText control is used to control <input type="text"> and <input type="password"> elements. In HTML, these elements are used to create a text field and a password field.http://msdn.microsoft.com/en-us/library/620b4fzf(VS.71).aspx having the total description of ASP names for HTML controls.  dakshitha http://forums.asp.net/t/1314103.aspx Hope it helps!!.N...

Access dynamically created controls
Hi, i have a form where i have dynamically created different web controls. this is sort of 'contact us form'. now i want to send data filled in those web controls to be sent as an email. the problem i m having is to access dynamically created web controls like textboxes in button click event and retrieve data from them. is there some workaround? Hi, haven't you mantained a reference to the created objects? i.e.: when you create your controls with code like this: TextBox myTextBox = new TextBox();   you can read its properties like you do with static controls: stri...

Access Dynamically Created CheckBoxlists
Hi i have managed to dynamically create and fill several checkboxlists on an asp.net page but now when i try and access whether or not they have been check i cannot manage to find any of the dynamically created controls on the page. i used the idea behind this tutorial here http://www.codeproject.com/useritems/DynamicServerControls.asp[^] so im just wonderin if anyone has any ideas why i cant access the new controls on the page i have tried each of these ways to access them, thanks in advance, Tim private void createFile_Click(object sender, System.Web.UI.ImageClickEventArgs e)...

accessing dynamically created textboxes
Hi, I've created textboxes on my page through a loop that adds them to a placeholder.  Is there some kind of eval function that I can access this on a postback.  I want to be able to click a button that calls a Save() function and in there, I access all the textboxes.  I want the code to be able to do something like this: Public Sub Save()'....do some stuffDim myValues as ArrayListFor x = 0 To 20   myValues(x) = Eval("txt" & x & ".text")Next'....do some more stuffEnd Sub  Is there any way to do this? Thanks!! Here's one way you can do what you want...

accessing dynamically created textfields
I've got a .net form where most of the controls are laid out on the page.  However, there's a drop down and based on the user's selection, javascript adds a number of plain old input text boxes below the drop down.  When I submit the form, I'm able to get at all of the page controls that I laid out on the page manually.  But, when I use Request.Form[] to get to the javascript created inputs, they're coming back null.  How can I get to these values?  Thanks....

Accessing dynamically created controls
Hi, I am having some problems accessing controls that i have dynamically created. I think it will be easier to paste the code so you can see it. The code snippet is nothing inparticular. It just creates two controls and then tries to output the values of them (any comment on if there is a better way of creating controls will be welcomed). HTML CODE: <form id="Form1" method="post" runat="server"> <TABLE cellSpacing="1" cellPadding="1" width="300" border="1"> <TR> <TD...

Web resources about - MSHTML to access HTMLElements dynamically created with JavaScript - embarcadero.delphi.winsock

Introducing DOM Snitch, our passive in-the-browser reconnaissance tool
Every day modern web applications are becoming increasingly sophisticated, and as their complexity grows so does their attack surface. Previously ...

Microsoft launches Internet Explorer 9 Platform Preview 6
At the Professional Developer Conference PDC10 Today, Microsoft rolled out an updated Internet Explorer 9 platform preview and Internet Explorer ...

JavaScript FTW: Episode 2: Classes and Inheritance (and why it matters!)
As we discussed last time, if we have code that's disorganized and difficult to debug, coding performance and scalability optimizations becomes ...

Introducing DOM Snitch, our passive in-the-browser reconnaissance tool
... several approaches to intercepting JavaScript calls to key and potentially dangerous browser infrastructure such as document.write or HTMLElement.innerHTML ...

Windows 8 Dependency Property Strangeness
December 5, 2011 New York, N.Y. If this blog entry popped up in a search engine because you're having problems with defining and/or animating ...

Editing styles & DOM - Google Chrome
The Elements panel lets you see everything in one DOMtree, and allows inspection and on-the-fly editing of DOM elements.You will often visit ...

Expand and collapse content accessibly with progressive enhancement, jQuery, and ARIA
At Filament Group, We design engaging sites and apps for mobile, tablet, desktop and beyond that are simple to use and accessible to everyone. ...

Issues - chromium - An open-source project to help move the web forward. - Google Project Hosting
My favorites ▼ - Sign in chromium An open-source project to help move the web forward. Project Home Downloads Wiki Issues Code Search New issue ...

Let’s Code: Test-Driven JavaScript
... but that causes IE 8 to break. Huh?? A bit of spluttering and confusion later, we get back to the main goal, which is modifying HtmlElement ...

axis attribute - axis property (Internet Explorer)
Internet Explorer Dev Center Windows Desktop Hardware Internet Explorer Get started Plan Develop Sign in Technologies API reference Samples Community ...

Resources last updated: 11/25/2015 5:05:12 AM