Jump to content

Auto IT function for focus a control in a web page.


anand
 Share

Recommended Posts

Hi,

is any auto it function available to set the focus to a specific control in a web application?

Regards!

Anantharajan.

Don't let the dog eat your help file!

ControlFocus()

:P

Edit: Oops, a little to quick with the snarky reply (web page, not GUI), but it's still in your help file: _IEAction() with "focus".

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • 2 weeks later...

Hi,

I want to give focus during run time. For example, one commandbutton is present in a web page. What i want to do is change focus to that control(command button) during runtime and this is not for the window which is created by Auto IT. Think if you have more than one IE opened then you don't have unique properties of Text, ID,class name etc.. So we cannot use this function for give focus. Since we do not get unique values.

Thanks,

Anand

Link to comment
Share on other sites

You will get different control id and text every time when you run the script. So we don't have any fixed control id or text for our script. We can not use this method in this situation. If you know how to solve this problem then reply immediately plz.

Link to comment
Share on other sites

i have a similar problem, i'm trying to press a website button automatically but the button does not have an id or name, so i can't use IEgetobjbyid or IEgetobjbyname

Welcome to my Tombola!  Great prizes to be won, just put your hand (or paw) in, pick up a tombola
ticket, and see what prize you win.  Anything ending with a <b>0, 2 or 5</b> is a winner!
<p>
You can play the Tombola <i>once per day</i>.  Please do not create multiple accounts in order to play the tombola,
<b>we will freeze people we see doing this because its cheating!</b>
<p>
<center>
<form action='tombola2.phtml' method='post'>
<input type='submit' value='Play Tombola!'>
</form>
</center>
<It Shall Be Done>
Link to comment
Share on other sites

You will get different control id and text every time when you run the script. So we don't have any fixed control id or text for our script. We can not use this method in this situation.

Form elements like buttons in a web page do not have control IDs at all. They are Document Object Model (DOM) elements which IE gives AutoIt a COM Object interface to. You should be learning to use the IE.au3 UDF function ( _IE* ) in the help file to work with your page.

If you know how to solve this problem then reply immediately plz.

You really should try to not sound so desperate/demanding.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Thanks for your information. Next time i will take care about words(desperate/demanding).

Can you please send me the code to identify control names present in a page. Please give me example for google page.

Link to comment
Share on other sites

Thanks for your information. Next time i will take care about words(desperate/demanding).

Can you please send me the code to identify control names present in a page. Please give me example for google page.

All of the _IE* functions in the help file have excellent example scripts. Run those first and see how the object references to the various elements are retrieved and used. There is no point in me writing duplicate demos when there are so many good ones in the help file.

I understand that after checking out all those example scripts, you may not understand everything, but you will be able to ask a more direct question. It's a learning curve worth climbing.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...