Jump to content

Running JavaScript on a web page


Recommended Posts

This may be tough to explain as I have little knowledge of Javascript and how it is implemented on a web page, but here goes:

At my workplace we use a web-based application to manage all employees and track their education records. I've attached a screenshot of the form used to create a new user. I am able to fill out the form fine, however I cannot click the 'Save' button. From the little I know about JS I can paste the code that is executed by the save button (javascript:__doPostBack('ctl00$Content$wizPerson$StepNavigationTemplateContainerID$btnStepSave','')) into the address bar and it will "push" the button, but I don't know how to do this in AutoIt. I've tried _IENavigate and looked at the _IEFormSubmit and _IEFormReset functions but it seemed you could only run functions on objects you created. Unfortunately I can't give access to the site as it's password protected. Any pointers would be great! Thank you for your time.

Screenshot 03-06-2012 11.21.00.bmp

Link to comment
Share on other sites

I looked at this function and it seems to be what I want, but I don't know anything about Javascript, so I don't know what to use for the $o_object variable. Do I have to use a form of GetObjBy and try to find the object or is it something that is already written into the code of the page? Below is the html code of the button itself.

<a id="ctl00_Content_wizPerson_StepNavigationTemplateContainerID_btnStepSave" class="buttonB100" href="javascript:__doPostBack('ctl00$Content$wizPerson$StepNavigationTemplateContainerID$btnStepSave','')">Save</a>

I guess what I need to know is where do you get $o_object from in a page that you didnt create with the script itself and then I could use _IEAction($o_object, "click"). I hope I'm explaining this in an understandable way. Thanks again for your help!

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