Jump to content

easy problem


Recommended Posts

trying to fix a script I wrote years ago, its not working now. Its supposed to fill in the fields of a form.

if anyone can point me in the right direction I'd appreciate it.

Code:

For $i = 2 to $MaxValue-1
   _IENavigate($oIE,$handle[$i])

     _IELinkClickByText ($oIE, "Send a Message")       


$binFlag = False
        $oFrmItm_Btn01s = _IETagNameGetCollection($oIE, "input"); Get all tags that are of type "input"
        $iInputCnt = @extended
    
Next
        
If $iInputCnt Then
            For $Input In $oFrmItm_Btn01s; For each $Input found in the $oFrmItm_Btn01s collection,
                If $Input.type = "text"  And $input.name = "subj"  Then; if they match the following criteria
                    _IEFormElementSetValue($Input,$Title); inputs message title
                    $binFlag = True; set the flag
                    ExitLoop; and bail out of the loop
                EndIf
            Next
EndIf

Section of Page Source:

fieldset>

<legend>New Private Message</legend>

<table class="ftbt">

<tr><td align=right width=1%><b>To:</b></td><td width=100%><input type=text tabindex=1 name="to" maxlength=32 style="width:400px" value=""> <span class="ab"><a onclick="oAB('to');">Address Book</a></span></td></tr>

<tr><td align=right><b>Subject:</b></td><td><input type=text tabindex=2 name="subj" maxlength=64 style="width:400px" value=""></td></tr>

<tr><td align=right><b>Message:</b></td><td>

<div class="editor">

right now I'm just trying to get it to fill in the message subject.

The glass is neither half empty nor half full, it is simply twice as big as it needs to be.
Link to comment
Share on other sites

Why all the iterations through INPUT tags when the one you want has a name?

$oInput = _IEGetObjByName($oIE, "subj")
_IEFormElementSetValue($oInput, $Title)

You might use _IEFormElementGetObjByName() if required.

:idea:

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

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...