Sign in to follow this  
Followers 0
tommytx

How to use _FFSetValue to fill an html form

8 posts in this topic

Am I doing something wrong here.. does not seem to work... none of them had and id so can't use that.

My html
<input name="first_name" value="" required="">
<input name="last_name" value="" required="">
<input name="email" value="" required="" type="email">

<textarea rows="7" cols="10" name="message" id="message" class="autosave"

end html

_FFSetValue("Tommy","first_name")
_FFSetValue("Chandler","last_name")
_FFSetValue("joe@boe.com","email")

_FFSetValue("Now is the time for all good men.", "message")

Share this post


Link to post
Share on other sites



Have you tried with the optional $sMode parameter set to "name"?

_FFSetValue("Tommy","first_name","name")

Share this post


Link to post
Share on other sites

Thanks for the assist...

Does not fill it in but gives this at the end..

__FFSend ==> Socket Error
_FFCmd ==> Error return value
_FFSetValue ==> No match: $sElement: .getElementsByName('first_name')[0]
>Exit code: 0    Time: 4.178
 

Share this post


Link to post
Share on other sites

its all inside a form but the form has no id... if i need to id the form I suppose i  could give it a number since its the only form on the page

has no id and no name for the form...

Share this post


Link to post
Share on other sites

This is a function I use in one of my scripts. Perhaps you will find it useful:

Func UpdateWebForm($cField, $cValue)
    ; Remove non-alphanumeric characters such as quotation marks
    $cValue = StringRegExpReplace($cValue, "[^\w\d\s]", "")

    _FFXPath("//form//input[@name='" & $cField & "']")
    _FFCmd("FFau3.xpath.value='" & $cValue & "'")
EndFunc

Share this post


Link to post
Share on other sites

Danp2   thank you so much I have no idea what I just did but i found this

_FFSetValue("1", "amount", "name",0)

_FFSetValue("1", "amount", "name",1)

_FFSetValue("1", "amount", "name",2)

_FFSetValue("1", "amount", "name",3)

at this site http://www.autoit.de/index.php?page=Thread&threadID=24003
 

so having no idea what I am doing... I took your solution

_FFSetValue("Tommy","first_name","name")
and added the 0 at the end... and walla it works fine..
_FFSetValue("Tommy","first_name","name", 0)
so thanks again.. you set me on the right road...
 
can you explain what happened there.. maybe it will help me in the future.
 

Share this post


Link to post
Share on other sites

Ok... sorrry.. forgive me for trying to screw everybody's mind up... the 0 had nothing to do with it... your solution as written worked perfect.. thanks again...

Share this post


Link to post
Share on other sites

Open FF.au3 and examine the definition of _FFSetValue. The 4th parameter ($iIndex) is optional and defaults to zero if you don't provide one.

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