Sign in to follow this  
Followers 0
gmc2

Help with focus input box pls

7 posts in this topic

How could i put auto focus straight on input box?? Can't find it out

<form id=''form1''>
    <label for="form.text">Numéro de téléphone&nbsp;:</label>
    <div >
        <input id="formtext" name="text" type="text" value="" maxlength="50"/>
    </div>
</form>

 

  
  

Share this post


Link to post
Share on other sites



are you wanting to set focus or auto populate data into the form? If setting focus I imagine it would be ControlFocus. If you want to autofill it would be ControlSend. Examples in the help file definitely are very great spot and customizable on what you are going for :)

Share this post


Link to post
Share on other sites

could you give me exemple with my form, bcs i tried and i cannot get focus work on the input name text. It's on a website my browser is google chrome

 

<form id=''form1''>
    <label for="form.text">Numéro de téléphone&nbsp;:</label>
    <div >
        <input id="formtext" name="text" type="text" value="" maxlength="50"/>
    </div>
</form>

Share this post


Link to post
Share on other sites

no way i can get the focus work, even with IE UDF. Everything else is fine, but it doesnt focus on the  inputbox, Could you show me a fonctionnal exemple with code posted earlier please?

Share this post


Link to post
Share on other sites

You share all of 6 lines of HTML from the webpage, but want a functional example of code? How about:

  • Posting your code, so we can see the "everything else is fine" bits.
  • Posting at least the web page so we can see what you're seeing.
  • Posting a screenshot if you can't do either of the above.

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
#include <IE.au3>
 
$o_IE = _IECreate ()
_IENavigate ($o_IE, "http://127.0.0.1/autoit/focusTest")
 
; there is no name on the form, just ID form1
$o_SearchForm = _IEFormGetObjByName ($o_IE, "")
$o_Keywords = _IEFormElementGetObjByName ($o_SearchForm, "text")
_IEFormElementSetValue ($o_Keywords, "Allo")

Share this post


Link to post
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
Sign in to follow this  
Followers 0