Jump to content

Is this possible


Bert
 Share

Recommended Posts

Driving home today, I was thinking about the scripting problems I was having with IE.au3, and how much I have learned lately. ( :whistle: Thank Dale and Big_daddy! ;) ) and I had a thought. Is it possible to take a webpage that has a button on it, and change the function of that button from the client side?

We have a ticket system at work, and its one BIG problem is it doesn't have a field for a SN#. This is quite fustrating, for we can't track what is happening with the equipment that breaks. We currently use a field labled "vender ticket" for this when needed, but that field is used for other stuff also. What I'm thinking is adding a SN# field when certain criteria are met (Other fields have certain data, such as "Configuration - Hardware") and have the submit button changed so that it will also read the controls on the page, and send the information to a database that is not part of the program. It would be a separate database that would allow us to track the #SN.

The company won't spend the money to have the vender add the field to the source code. The standard company policy says use the software out of the box. No, don't say to change the software. That isn't possible, so I will not even discuss that. It is possible to have a "add-in" to the software and when it is running to have the changes made on the workstation. (I already have done this, and it works great.) I'm happy to take this offline and discuss in PM if needed. I can see the "darkside" of such a thing, but this usuage would NOT be for such. It would simply allow for me and the people I work with to easily track what is happening with equipment that breaks, and needs parts.

To put it simply, can you change the way a button functions on a webpage from the client side?

Edited by vollyman
Link to comment
Share on other sites

I don't know how adamant your company is or how strict your IT dept. is or how complex the software you are using is... but have you considered writing your own client ?

There's plenty of code in the forum to manipulate web pages, so in theory you could write your own client and then have the data transfered to the web page accordingly. Thus you really never need to view their version.

Just an idea. :whistle:

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Link to comment
Share on other sites

Writting my own client is not possible. I have to use what they provide me. The program is called Unicenter. (Made by COmputer Assoaciates) It is web based. This is what makes me think I can do what I proposed. The idea of designing a client to do what you ask is something I rather not attempt. (It would be daunting to say the least!) I rather just change one button, which would solve the problem.

Edited by vollyman
Link to comment
Share on other sites

To put it simply, can you change the way a button functions on a webpage from the client side?

Hi, not sure if I understand or that this help (hard to understand the english...)

Anyway:

If some page has a button that when onclicked does some javascript-function eg: myfunc()

then:

from autoit-exe (running on user)

- track for browser and html-page 'as usual'...

- rewrite the function dynamically like: (based on whatever info from page or user)

$NewFunction="myfunc(){"&"whatever"&"}"

$o_head = $oIE.document.all.tags ("head").Item (0)

$o_script = $oIE.document.createElement ("script");

With $o_script

.text = $NewFunction

EndWith

$o_head.appendChild ($o_script)

- This will 'overwrite' (if already exist) the javascript-function and act like it

Hope it helps...

PS: to add:

you can rewrite anything on any webpage-object like:

V_objLink2[V_i].onmouseover = new Function("this.style.cursor='wait';");

V_objLink2[V_i].onclick = new Function("return false;");

which of course could be part of your 'new' function

etc.

Harry

Edited by heibel
Link to comment
Share on other sites

The short answer is "yes". There would be many ways to approach this.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

You can consider putting together a frontend (either a webpage or an AutoIt GUI) that collects all of the information for Unicenter plus your SN... then you populate your database with the appropriate information and pas the required data to the Unicenter web form and submit it...

You can also tap into the form submit event in the browser and popup a web browser with some of the info from the Unicenter form and prompt for the SN and then store all that info in your database.

You can dynamically add a field to your Unicenter web page for SN (I wouldn't add it to the main unicenter <form > however) and then tap into the onsubmit event to take appropriate action with that data.

Aother approach would be to find another field on the Unicenter form, indeally a textarea with lots of room, and enter structured data into it that you can later parse and report on using your Unicenter database (no need for a seperate database). Something like <SN>yourserialnumberhere</SN> or /SN/yourserialnumberhere/ or %%SN:yourserialnumberhere%%

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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