Jump to content
Sign in to follow this  
digiworks

Running JavaScript on a web page

Recommended Posts

digiworks

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

Share this post


Link to post
Share on other sites
wakillon

Look at _IEAction in help file with "click" action :oops:


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
digiworks

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!

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  

×