IE form buttons not recording properly

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
mpopkin
Newbie
Posts: 15
Joined: Wed Dec 17, 2008 5:56 pm

IE form buttons not recording properly

Post by mpopkin » Mon Jan 19, 2009 6:20 pm

Hi All,

I have a web form with two buttons on it, each runs a different javascript in the page. The problem is, WebRecorder records them both as identical steps, even though they should run different functions:

(WebRecorder results for either button)

Code: Select all

  Let>FrameName={"workarea_frame"}
  Let>FormName={"ReportQuery"}
  Let>TagValue={""}
  IE_ClickTag>%IE[3]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue,r

Here are the button sources:

Code: Select all

<input onClick="javascript: doCustomQuery('ReportQuery')" class="cGoButton" value="Go" type="BUTTON"></input>

<input onClick="javascript: doSearch('ReportQuery', '');" class="cGoButton" value="Go" type="BUTTON"></input>
And this is what the javascripts look like:

Code: Select all

    function doSearch(formId, searchText)
    {
        if(searchText == '')
        {
                        searchText = getElementValue(formId, formId + '_search_text');
            searchText = replace(searchText, "%", "");
        }

        //  we need to wrap the string 'null' in quotes
        //  otherwise it does not come in as a parameter to the list filtering
        if(searchText.toLowerCase() == 'null')
        {
            searchText = "'" + searchText + "'";
        }

        setElementValue(formId, formId + '_search_text', TRIM(searchText));

        var actionLink = "/long/dynamic........./URL/here";
        eval('document.' + formId + '.action = actionLink;');
        eval('document.' + formId + '.submit();');
    }

function doCustomQuery(formId)
{
    var actionLink = "/ANOTHER/long/dynamic........./URL/here";
    eval('document.' + formId + '.action = actionLink;');
    eval('document.' + formId + '.submit();');
}
Any ideas on how I could get these links to run correctly?

TIA

-mp

mpopkin
Newbie
Posts: 15
Joined: Wed Dec 17, 2008 5:56 pm

Post by mpopkin » Mon Jan 19, 2009 8:29 pm

Nevermind.

I figured out how to work it using the ClickTag INDEX attrib.

That allowed me to click the buttons individually.

Hope this helps someone else.

thanks!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts