SilverStr
Posts: 28
Joined: 2013-03-31
|
OK, so I am finding the power of the Add-In Express world. But as I progress in the testing, I am coming across interesting ways webmasters are screwing with traditional forms, making it difficult to get my work done.
Let me give you an example. Here is Dell's login page: http://ecomm.dell.com/myaccount/login.aspx
Notice how there is a "Sign In" button that looks like a green pill. That isn't a standard input button or even an input image. Instead, it seems to show in dxiehtmlDocEvents_OnClick() as an HTMLDivElementClass.
I am intercepting anchors in OnClick, so why is it showing as a div?
What I want is to detect what caused the click event, and record it. In this case, it would be the underlying anchor tag that shows as:
<a href="javascript:Validate();" style="text-decoration:none">
As I try to crawl the stack I am not finding that href anywhere. How do I go about getting it from the HTMLDivElement in OnClick()? Or alternatively, how can I capture the click on the anchor and actual see it come in as a HTMLAnchorElement (or something similar)? |
|
Sergey Grischenko
Add-in Express team
Posts: 7233
Joined: 2004-07-05
|
Hi Dana,
When I click on the 'Sign-in / Register' link I get the anchor element. What version of IE do you use? |
|
SilverStr
Posts: 28
Joined: 2013-03-31
|
I am testing on IE9 and IE10. (Win7 and Win8) |
|
Sergey Grischenko
Add-in Express team
Posts: 7233
Joined: 2004-07-05
|
I also tested it in Win7+IE10.
Here is my code:
private void adxiehtmlDocEvents1_OnClick(object sender, object eventObject, ADXCancelEventArgs e)
{
mshtml.IHTMLEventObj2 eventObj = eventObject as mshtml.IHTMLEventObj2;
if (eventObj != null && eventObj.srcElement != null)
{
if (eventObj.srcElement is mshtml.IHTMLAnchorElement2)
{
}
}
}
The SupportedEvents property of the 'ADXIEHTMLDocEvents' component is set to 'Anchors'. |
|
SilverStr
Posts: 28
Joined: 2013-03-31
|
I think the problem I have is that the SupportedEvents I am monitoring for include a whole lot more, so its getting called quite a bit.
As an example, I have to monitor the clicking of divs because some websites actually build their "s ubmit" buttons off of div tags with javascript actions. (Ya, it's stupid). So what happens in Dell's site as an example, I am getting an entry for the surrounding div instead of the anchor.
This afternoon I will look deeper to see if I can give you more detailed information to help explain how I am seeing it happen. With the weekend I don't expect I will hear back from you, but hopefully we can pick this up when you are back in the office.
Have a great weekend! |
|
Sergey Grischenko
Add-in Express team
Posts: 7233
Joined: 2004-07-05
|
Hi Dana,
Thank you. Please ask me any questions. |
|