Jump to content

_IEFormGetObjByName


kram
 Share

Recommended Posts

Hi Everyone,

I've made scripts in the past to toggle check boxes in a table without issue, but for some reason I am running into trouble now. 

_IEFormGetObjByName is returning a NoMatch error.

The IEAttach function works without error.

There's some sensitive information in the HTML, or I'd paste the entire page here. There is only 1 form name:

</head>
<body onLoad=tzinitialize()>
<form name="UserEdit" method="post" action="users.asp">
  <font class="pageheader">Edit Users</font><br>
  <hr color="#000000" width="500" align="left" style="height:1px;">
 
  <font class="sansxxsmallblack"><b>Editing User: <i></i><b> </font><br>
  <input type="hidden" name="cmd" value="update">

As you can see the form name is "UserEdit", which I have set in IEFormGetObjByName:

Local $oForm = _IEFormGetObjByName($oIE, "UserEdit")

This results in "Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch"

Why is there no match?

All I'm trying to do is toggle a check box within each table on the page:

<tr>
        <td align="center" class="clsTableRow1 clsRowHasInput">
            <input type="checkbox" id="a3743445_c701_4846_a772_f242e3fd4ecf" name="groupCheckBox" 
              onclick="return onclickGroupCheckBox();" 
              value="a3743445-c701-4846-a772-f242e3fd4ecf" >
        </td>
        <td align="center" class="clsTableRow1 clsRowHasInput">
            <input type="checkbox" id="gdcba3743445_c701_4846_a772_f242e3fd4ecf" name="groupdefCheckBox" 
              value="a3743445-c701-4846-a772-f242e3fd4ecf" DISABLED>
        </td>
        <td class="clsTableRow1" nowrap >
          <a title="zzzz Liason">zzzz Liason</a>
        </td>
        <td class="clsTableRow1">
 
              <a title="This type of groups operates its own queue for handling issue or request submissions.">Queue</a>
 
      </td>
    </tr>

What the heck am I doing wrong here? 

Link to comment
Share on other sites

  • Moderators

Just a guess... You need to work within the frame/iframe object.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

So I ran the _IEFrameGetCollection example from the help section to see what if any frames I am dealing with

Example code:

Local $oIE = _IEAttach ( "https://companyURL.asp", "url" )
If @error Then MsgBox(0,'_IEAttach error', @error)

Local $oFrames = _IEFrameGetCollection($oIE)
Local $iNumFrames = @extended
Local $sTxt = $iNumFrames & " frames found" & @CRLF & @CRLF
Local $oFrame = 0
For $i = 0 To ($iNumFrames - 1)
    $oFrame = _IEFrameGetCollection($oIE, $i)
    $sTxt &= _IEPropertyGet($oFrame, "innertext") & @CRLF
Next
MsgBox($MB_SYSTEMMODAL, "Frames Info", $sTxt)


_IELoadWait($oFrame)

and get the following result from the MsgBox

"2 frames found

 

CHTWEB-CH2-14P | https://companyURL.com/ | Username |

Last Login: 12/12/2014 9:39:46 AM

0

"

That's all I get. I intentionally added the spacing to replicate exactly how I see the MsgBox. Is there a better way to check for frames/iframes on a page?

Edited by kram
Link to comment
Share on other sites

  • Moderators

I personally treat frames/iframes as their own web page and a new dom.

Try to read the html from the object (_IEBodyReadHTML maybe).

To be honest, this is just a guessing game, you really limit yourself without being able to access the page to help.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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