×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Form manipulation via VBS - need form to update after 1st selection

Form manipulation via VBS - need form to update after 1st selection

Form manipulation via VBS - need form to update after 1st selection

(OP)
I created a script to BEGIN to do what I need. This script interacts with the initial form. I can fill out the form and submit, but it errors. Upon further inspection, after a selection is made in the first dropdown field, the form is supposed to refresh with updated dropdown options. With my code, it doesn't allow the form to refresh after the first selection is made. Here is my somewhat-working code:

set ie = createobject("internetexplorer.application") 
Set objShell = CreateObject("WScript.Shell")
 
ie.navigate "https://www.myfloridalicense.com/wl11.asp?Mode=1&SID=&brd=&typ="
ie.Visible = True
do until ie.readystate = 4 : wscript.sleep 10: loop 
 
IE.Document.getElementsByTagName("select")("Board").Value = "25"
do until ie.readystate = 4 : wscript.sleep 10: loop 
IE.Document.getElementsByTagName("select")("County").Value = "11"
IE.Document.getElementsByTagName("select")("RecsPerPage").Value = "50"
 
For Each btn In IE.Document.getElementsByTagName("input")
If btn.type = "image" Then 
btn.Click()
Next
 
My question is - how do I allow the form to update after the first selection? First selection being:
IE.Document.getElementsByTagName("select")("Board").Value = "25" 

I tried adding this after, but no dice:

do until ie.readystate = 4 : wscript.sleep 10: loop 


Thanks in advance

RE: Form manipulation via VBS - need form to update after 1st selection

(OP)
Does my question make sense? I'm happy to clarify. TIA!

RE: Form manipulation via VBS - need form to update after 1st selection

I don't know what events are triggered (if any) while javascript updates a select input based on another selection, as this site does. If nothing else, you could try:

CODE

While IE.Busy
   WScript.Sleep 1000 'delay 1 second
Wend 

... or just set a delay long enough to get it to work, but it may fail if the delay is not long enough.

CODE

WScript.Sleep 1000 'delay 1 second 

RE: Form manipulation via VBS - need form to update after 1st selection

(OP)
Yea, I tried a delay. I think I need to reference some time of form function, but not sure how to do that. If you go to that link and select an object in the first drop down, you see the subsequent dropdowns change. I have to trigger THAT somehow...

RE: Form manipulation via VBS - need form to update after 1st selection

(OP)
some *kind

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close