Jump to content

Send string data to HTML textbox


gr8BigGeek
 Share

Recommended Posts

Greetings,

I am needing to search a txt file for latitude and longitude and capture those characters and do the following:

- send the latitude into a textbox called "latbox1"

- send the longitude into a textbox called :lonbox1"

of an .html document I have setting on the c drive; then submit the data. The .html page works just fine allowing multiple entries; by this I mean that you can enter multiple lat/lon and submit them and it will continue to place more and more blue dots or points on the map.

I have a few questions though. First look over the attached document:

[sun Aug 29 14:07:00 2010] |AVL1|UNIT1A|-111685280|33327890|0870|0870|053000|053000|||||75564000|0|2|1000|2|20||

[sun Aug 29 14:07:00 2010] |AVL1|UNIT1B|-109859300|35015400|2330|2330|080000|080000|||||76030000|2|2|1000|2|20||

[sun Aug 29 14:07:00 2010] |AVL1|UNIT1C|-111858020|33287410|2700|2700|073000|073000|||||76029000|0|2|1000|2|20||

[sun Aug 29 14:07:00 2010] |AVL1|1C|-110808480|32618380|1810|1810|000000|000000|||||76029000|0|2|1000|4|20||

[sun Aug 29 14:07:00 2010] |AVL1|UNIT1A|-112074730|33392300|2700|2700|000000|000000|||||76028000|0|2|1000|2|20||

[sun Aug 29 14:07:00 2010] |AVL1|UNIT1B|-112012390|33576050|2650|2650|000000|000000|||||76030000|2|2|1000|4|20||

[sun Aug 29 14:07:00 2010] |AVL1|UNIT1C|-112248120|33606430|0480|0480|000000|000000|||||76029000|0|2|1000|5|20||

[sun Aug 29 14:07:00 2010] |AVL1|1C|-112074730|33392300|2700|2700|000000|000000|||||76029000|0|2|1000|2|20||

[sun Aug 29 14:07:01 2010] |AVL1|UNIT1A|-112248120|33606430|0480|0480|000000|000000|||||76030000|0|2|1000|5|20||

[sun Aug 29 14:07:01 2010] |AVL1|UNIT1B|-111858380|33287410|2700|2700|073000|073000|||||76030000|0|2|1000|2|20||

[sun Aug 29 14:07:01 2010] |AVL1|UNIT1C|-111643700|33347750|3590|3590|070000|070000|||||76030000|0|2|1000|2|20||

[sun Aug 29 14:07:02 2010] |AVL1|UNIT1A|-112117770|33713770|1700|1700|070000|070000|||||76031000|0|2|1000|3|20||

[sun Aug 29 14:07:02 2010] |AVL1|UNIT1B|-111890300|33432250|0720|0720|044000|044000|||||76031000|0|2|1000|3|20||

[sun Aug 29 14:07:02 2010] |AVL1|UNIT1C|-111643700|33348050|3590|3590|072000|072000|||||76031000|0|2|1000|2|20||

[sun Aug 29 14:07:03 2010] |AVL1|1C|-111501900|36948600|2380|2380|001000|001000|||||76033000|2|2|1000|4|20||

[sun Aug 29 14:07:03 2010] |AVL1|UNIT1A|-111643720|33348340|3600|3600|073000|073000|||||76032000|0|2|1000|2|20||

see how the information is uploaded in batches or sections. I need to go to the last updated time, stop there and update only the latest information. I don't need to keep on going back. I simply need to update what has just come in. I have posted previously here:

http://www.autoitscript.com/forum/index.php?showtopic=119917&pid=833222&st=0&#entry833222

but didn't get much of a response. I am really needing to change up my code and was hoping to gain some insight as to how to go about doing it. I understand how to convert the information into a str and then send that as a URL but how do you enter information into a specific textbox within a webpage?

How can you refresh the page so that you erase an old "blue dot" (for say Unit1A) and replace it with the updated information (for Unit1A). This is because each "blue dot" is representing a vehicle or sales person in the field. If you reference the above link you will see the current au3 file I am using currently but that allows me to ping only one unit at a time. I was trying to get all units shown on the map at any given time.

Just as you can left click on each blue dot and get the lat/lon spelled out I thought you could left click and get the unit information as it is spelled out on the screen of the "Unit Locator.au3" (again please see previous post link above to download file) in the same format along with the lat/lon.

I am still working on the Javascript code to see how I can get the Javascript popup balloon to display:

Unit Name: Unit1A

Time of last position: Sun Aug 29 14:07:00 2010

Latitude: 33.459150

Longitude: -111.839080

when you left click on the blue dot.

Is there anyone that knows how to cause an autoit program to continue looping and updating information? I need to continue to search this txt file and take the most recent information added and send it to textboxes while erasing the old blue dots.

I figure by now you get the idea. I think I'm just tired and repeating myself now. I've been working on this for such a long time. Just the Javascripting alone was enough for me. I'm not as good in Autoit as I am in VB. I'm about to throw my hands up with Autoit and just write this all in VB.

Any help you can provide would be wonderful.

Thanks again

Matt~

Link to comment
Share on other sites

There are several ways to loop arguments (which I guess you probably already know): For ... Next, While ... WEnd, Do ... Until. Unfortunately I haven't done much automating of web pages, so I can't give you a concrete answer. However I do know that there are several IE functions described in the help file, and probably several UDFs in the Example Scripts Forum which may be useful. What you are asking doesn't sound particularly difficult. That is if I understood you correctly. You just need to update some input boxes (right?). Familiarize yourself with the IE functions in the help file, if you haven't done so already.

Nice code BTW.

Edit

Hmm, I must have skipped over this part.

If you reference the above link you will see the current au3 file I am using currently but that allows me to ping only one unit at a time. I was trying to get all units shown on the map at any given time.

A thought just occured to me. Firstly Google maps probably has some code that does all of this for you. That's something I don't know.

Secondly, and after playing around with it a bit, I have thought of a possible method, although I admit it's not perfect. You can add as many balloons as you need (at least it seems that way) and store their screen coordinates in an array. Providing that the map remains at the same position and resolution, then you can click drag the balloons to any location you want. You can quite easily set the resolution beforehand, and I'm sure there must be ways to set the position of the map too. If you don't find a better solution, then perhaps using this approach will be adequate, for the time being at least.

If you require more than one map for all the balloons, then I guess you will have to store them as separate arrays, or something along those lines. Perhaps another idea would be to refresh the map and then resend all the updated coordinates.

Edited by czardas
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...