Jump to content

Javascript/form/html problem


Recommended Posts

I have this bit of code that I'm trying to automate. This block is the portion that submits the login information. I've tried a few of the IE.au3 commands to activate this submit button but I'm pretty lost with it.

Am I needing to kick off the validate or should doing an image click or link click work?

CODE
<TR>

<TD class=loginText align=right colSpan=2>

<DIV class=btnLogin>

<BUTTON onclick="return Validate()" name=in_su_dologin508 type=submit ID="Button1">

<A class=submitBtn href="#"><IMG alt=Login src="../MLLoginPages/ClientNetLogin_files/btnLogin.gif"></A>

</BUTTON>&nbsp;

</DIV>&nbsp;

<INPUT id=input3 type=hidden alt=authsourceID value=Insight name=in_hi_authsource></INPUT>

</TD>

</TR>

I should add.... This is what I get from the button source using DeveloperToolbar

CODE
<BUTTON id="Button1" onclick="return Validate()" name="in_su_dologin508" type="submit">

<A class="submitBtn" href="#"></A>

<IMG alt="Login" src="https://clients.messagelabs.com/MLLoginPages/ClientNetLogin_files/btnLogin.gif" />

</A><//A></BUTTON>

I don't need code... just a little direction.

Thanks in advance.

Edited by twillster
Link to comment
Share on other sites

I have this bit of code that I'm trying to automate. This block is the portion that submits the login information. I've tried a few of the IE.au3 commands to activate this submit button but I'm pretty lost with it.

Am I needing to kick off the validate or should doing an image click or link click work?

CODE
<TR>

<TD class=loginText align=right colSpan=2>

<DIV class=btnLogin>

<BUTTON onclick="return Validate()" name=in_su_dologin508 type=submit ID="Button1">

<A class=submitBtn href="#"><IMG alt=Login src="../MLLoginPages/ClientNetLogin_files/btnLogin.gif"></A>

</BUTTON>&nbsp;

</DIV>&nbsp;

<INPUT id=input3 type=hidden alt=authsourceID value=Insight name=in_hi_authsource></INPUT>

</TD>

</TR>

I should add.... This is what I get from the button source using DeveloperToolbar

CODE
<BUTTON id="Button1" onclick="return Validate()" name="in_su_dologin508" type="submit">

<A class="submitBtn" href="#"></A>

<IMG alt="Login" src="https://clients.messagelabs.com/MLLoginPages/ClientNetLogin_files/btnLogin.gif" />

</A><//A></BUTTON>

I don't need code... just a little direction.

Thanks in advance.

Did you look at it with DebugBar for the path?

Did you try _IEFormElementGetObjByName($oForm, "in_su_dologin508")?

Have you successfully drilled down into the Frames/iFrames/Forms to the object?

: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

Okay, I will try to answer these as best as I can. I'm having a time of it understanding the complexity of the DOM objects and all that stuff within IE.

I have looked at DebugBar for the path. The code for the entire page is questionable at best and confusing as all hell.

IEFormElementGetObjByName does return successfully but what do I do with that object once I have it? Is there a simple way to return or enumerate collections that I haven't been able to find?

I have drilled down into the frames/iframes/forms etc. The username and password boxes are in the same form and I have been able to populate those boxes with the username and password but now I need to be able to submit via the small block of code that I listed up top. Unfortunately I haven't ever dealt with the <BUTTON> object so wasn't sure how to "click" it.

Thanks again for the help. I'll keep digging.

Link to comment
Share on other sites

Okay, I will try to answer these as best as I can. I'm having a time of it understanding the complexity of the DOM objects and all that stuff within IE.

I have looked at DebugBar for the path. The code for the entire page is questionable at best and confusing as all hell.

IEFormElementGetObjByName does return successfully but what do I do with that object once I have it? Is there a simple way to return or enumerate collections that I haven't been able to find?

I have drilled down into the frames/iframes/forms etc. The username and password boxes are in the same form and I have been able to populate those boxes with the username and password but now I need to be able to submit via the small block of code that I listed up top. Unfortunately I haven't ever dealt with the <BUTTON> object so wasn't sure how to "click" it.

Thanks again for the help. I'll keep digging.

By default, you get instance 0 (first one) back, not a collection.

To click it:

$oButton = _IEFormElementGetObjByName($oForm, "in_su_dologin508")
_IEAction($oButton, "click")

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