Sign in to follow this  
Followers 0
Dipendra

buttons defined in a class

6 posts in this topic

Hi everyone...

Problem is that the UI has a button class which is defined in a css file. How do i get a reference to this...

Here is the jsp:

<form name="NewForm" action=XXX method="post">

<table align="center">

<tr>

<td width="150" valign="top" nowrap >

<div id="leftLayer" class="leftLayer">

<div class="buttonTitles">For the Page</div>

<div class="button"><div class="back"><a class="button" href="java script:submitForm('AddItem')">Submit</a></div></div>

..............................

..................

........

<table border="1" width="100%">

<input type="hidden" name="pageaction">

<tr><td>

<table cellspacing="1" cellpadding="3" width="100%">

<tr >

..............

.........

.....

Now if i use this piece of code:

$oIE = _IECreate ("http://www.xxx.com/")

$oForm = _IEFormGetCollection ($oIE,0)

$oText = _IEFormElementGetObjByName ($oForm, "pageaction")

_IEAction($oText,"click")

This wont work...

Actually if i could get a reference to the Submit button that would solve my problem.. but that class is defined in some css file

Is there a way out of this mess :)

Share this post


Link to post
Share on other sites



$oIE = _IECreate ("http://www.xxx.com/")

$oForm = _IEFormGetCollection ($oIE,0)

$oText = _IEFormElementGetObjByName ($oForm, "button")

_IEAction($oText,"click")

I'm thinking that would work better?? Not sure though.

Share this post


Link to post
Share on other sites

$oIE = _IECreate ("http://www.xxx.com/")

$oForm = _IEFormGetCollection ($oIE,0)

$oText = _IEFormElementGetObjByName ($oForm, "button")

_IEAction($oText,"click")

I'm thinking that would work better?? Not sure though.

THis wont work either because button is not recognized as a name in this case..

actually there is another line of code for reset..which i did not add in my example above..we have two button here..

<table align="center">

<tr>

<td width="150" valign="top" nowrap >

<div id="leftLayer" class="leftLayer">

<div class="buttonTitles">For the Page</div>

<div class="button"><div class="back"><a class="button" href="java script:submitForm('AddItem')">Submit</a></div></div>

<div class="button"><div class="back"><a class="button" href="java script:document.forms[0].reset();">Reset</a></div></div>

</td>

Share this post


Link to post
Share on other sites

something like this worked for me:

$oForms = _IEFormGetCollection ($oIE,0)
For $Form In $oForms
    If StringInStr($oForm, "Submit") Then
        _IEAction($oForm, "click")
        ExitLoop
    EndIf
Next

or maybe this:

$oForms = _IEFormGetCollection ($oIE,0)
For $Form In $oForms
    If StringInStr($oForm, "Button") Then
        _IEAction($oForm, "click")
        ExitLoop
    EndIf
Next

Share this post


Link to post
Share on other sites

something like this worked for me:

$oForms = _IEFormGetCollection ($oIE,0)
For $Form In $oForms
    If StringInStr($oForm, "Submit") Then
        _IEAction($oForm, "click")
        ExitLoop
    EndIf
Next

or maybe this:

$oForms = _IEFormGetCollection ($oIE,0)
For $Form In $oForms
    If StringInStr($oForm, "Button") Then
        _IEAction($oForm, "click")
        ExitLoop
    EndIf
Next

Nope buddy... this does not work for me..

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