|
-
Dec 17th, 2009, 08:24 AM
#1
Thread Starter
New Member
[RESOLVED] f.submit not working for website
The very basic code below populates the trainline form online. When I come to submit the form, the page just refreshes itself. If I omit the f.submit command and press the online button myself it works. Is there another option for submitting or do i have the wrong command? Any advice or help appreciated.
Code:
Sub get_times_test()
Set web = CreateObject("InternetExplorer.Application")
web.Navigate2 "http://www.thetrainline.com/buytickets/?href=&T2ID=8507_20078301696"
web.Visible = True
Do Until web.ReadyState = 4
DoEvents
Loop
Set f = web.Document.forms(0)
f("OriginStation").Value = "LDS"
f("DestinationStation").Value = "MAN"
f("outwardDate").Value = "20/12/09"
f("OpenReturnJourneyCheckBox").Checked = True
f.submit
End Sub
-
Dec 17th, 2009, 03:10 PM
#2
Re: f.submit not working for website
try
f("extendedSearch").click
as there is more than one submit button, hard to know which is submitted
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Dec 18th, 2009, 06:36 AM
#3
Thread Starter
New Member
Re: [RESOLVED] f.submit not working for website
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|