Auto complete

Add-in Express™ Support Service
That's what is more important than anything else

Auto complete
auto fill form on IE 
pa1 modi




Posts: 84
Joined: 2011-06-18
hi sergey,

how to add onClick event on textbox of login webpage like gmail,yahoo etc..

i use adxiehtmlDocEvents1_OnClick event and then in SupportedEvents property of the component,i select HTML control type(s) 'inputtext'..

but its fire onClick event for all text box on webpage..


private void adxiehtmlDocEvents1_OnClick(object sender, object eventObject, ADXCancelEventArgs e)
{

............
................some code
..........
}

i just want to fire event only for login webpages..like yahoo,gmail etc..
Posted 05 Sep, 2011 02:01:28 Top
pa1 modi




Posts: 84
Joined: 2011-06-18
i use adxiehtmlDocEvents1_OnClick event for open popup window by clicking on button of webpage.

In SupportedEvents property of the component,

Which HTML control type(s) i select for button onClick event..??


private void adxiehtmlDocEvents1_OnClick(object sender, object eventObject, ADXCancelEventArgs e)
{
}
Posted 05 Sep, 2011 08:19:12 Top
Sergey Grischenko


Add-in Express team


Posts: 7228
Joined: 2004-07-05
Hi Pavan.

how to add onClick event on textbox of login webpage like gmail,yahoo etc..

To implement it you need to know the id or name of the target control.
Then you need to check the id/name of the clicked control in the OnClick event handler and if it matches the condition, you can perform some code.
Posted 05 Sep, 2011 10:04:30 Top
Sergey Grischenko


Add-in Express team


Posts: 7228
Joined: 2004-07-05
Which HTML control type(s) i select for button onClick event..??

SupportedEvents = InputText
Posted 05 Sep, 2011 10:11:02 Top
pa1 modi




Posts: 84
Joined: 2011-06-18
thanks,


SupportedEvents = InputText is perform action textboxes not on the button..

so which HTML controll type is use for button click event of webpage like gmail,yahoo..?
Posted 06 Sep, 2011 02:46:29 Top
Sergey Grischenko


Add-in Express team


Posts: 7228
Joined: 2004-07-05
Hi Pavan.

You need to set SupportedEvents to Document and use the code below to check if it is the button that you need.

private void adxiehtmlDocEvents1_OnClick(object sender, object eventObject, ADXCancelEventArgs e)
{
if (eventObject is mshtml.IHTMLEventObj2)
{
if (((mshtml.IHTMLEventObj2)eventObject).srcElement is mshtml.IHTMLElement)
{
mshtml.IHTMLElement input =
((mshtml.IHTMLEventObj2)eventObject).srcElement as mshtml.IHTMLElement;
if ((!String.IsNullOrEmpty(input.id)) && input.id.ToLower() == "signin")
{
MessageBox.Show(this, "Ok");
}
}
}
}
Posted 06 Sep, 2011 06:23:16 Top
pa1 modi




Posts: 84
Joined: 2011-06-18
thanks,

i have check it but its only work with gmail "sign in" button not with yaohoo's or another..
Posted 06 Sep, 2011 06:41:18 Top
Sergey Grischenko


Add-in Express team


Posts: 7228
Joined: 2004-07-05
View->Source in IE and you will see the source code of any pages. You just need to find the control tag and use it in the add-on code. Also you can check if 'srcElement' is IHTMLInputElement. And if so, you can perform your action. But in this case, there is not any guarantee that the button is the 'Sign In' one.
Posted 06 Sep, 2011 06:52:11 Top
pa1 modi




Posts: 84
Joined: 2011-06-18
it's okie thanks,

but i need button as well as textbox click event together.

for example,

there are two messagebox 1 and messagebox 2

when i click on textbox of gmail loginPage then messagebox 1 will show but not by button of gmail.

And when i click on button of gmail loginPage then messagebox 2 will show but not click by textbox.
Posted 06 Sep, 2011 07:09:43 Top
Sergey Grischenko


Add-in Express team


Posts: 7228
Joined: 2004-07-05
For the textbox: 'srcElement' will be an instance of the mshtml.IHTMLInputTextElement type.
Posted 06 Sep, 2011 08:07:50 Top