|
-
Jan 6th, 2004, 05:56 AM
#1
Thread Starter
Lively Member
logging on to web
hi I am trying to log on to a web page through my program using this code:
Private Sub Command1_Click()
'WebBrowser1.Navigate
WebBrowser1.Navigate ("http://www.mysite.com/")
Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
WebBrowser1.Document.Forms(0).uname.Value = Text1.Text
WebBrowser1.Document.Forms(0).uemail.Value = Text2.Text
WebBrowser1.Document.Forms(0).psword.Value = Text3.Text
WebBrowser1.Document.Form(0).submit
End Sub
but I am getting error at this line: WebBrowser1.Document.Form(0).submit
it just wont submit, the ollowing code is from the we page source:
<td align="center"><font color="black">Username:</font></td>
</tr>
<tr>
<td align="center"><input class="login_input" type="text" name="uname" value=""></td>
</tr>
<tr>
<td align="center"><font color="black">Email:</font></td>
</tr>
<tr>
<td align="center"><input class="login_input" type="text" name="uemail" value=""></td>
</tr>
<tr>
<td align="center"><font color="black">Password:</font></td>
</tr>
<tr>
<td align="center"><input class="login_input" type="password" name="psword"></td>
</tr>
<tr>
<td align="center" style="padding-top: 5px;"><input class="login_input" type="submit" value="Login" style="width: 50px;"></td>
</tr>
</table>
<input type="hidden" name="hash" value="e97be0c74dd6e21be069e57c7fe40c9a">
-
Jan 6th, 2004, 11:12 AM
#2
Hyperactive Member
Don't know how much this will help but:
I noticed on the submit line of code its "Form(0)" whereas the other lines have "Forms (0)". Is this is perhaps?
cjqp
-
Jan 6th, 2004, 03:44 PM
#3
Thread Starter
Lively Member
logging on to web solved
perhaps, cjqp ? nope u are correct, it is that!!!
thanks for pointing it out!! its the little things we miss and believe me I went over it how many times and still couldn't see it :-)
-
Jan 6th, 2004, 03:48 PM
#4
Hyperactive Member
Your welcome
Reason I said perhaps is because I havn't done much with the Webbrowser control..and nothing like munipulaing forms...And yes, little things are hard to miss, especially when we think we've coded it right even when it complains.
cjqp
-
Jan 6th, 2004, 04:27 PM
#5
Thread Starter
Lively Member
actually I still do have a problem,
It logs on to the site correctly now, but once logged on it loops and tries to log on again which produces an error.
-
Jan 6th, 2004, 05:02 PM
#6
Hyperactive Member
I don't see why it would do that...but try this:
VB Code:
Dim hasLogged As Boolean
hasLogged = False
Do While hasLogged = False
'WebBrowser1.Navigate
WebBrowser1.Navigate ("http://www.mysite.com/")
Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
WebBrowser1.Document.Forms(0).uname.Value = Text1.Text
WebBrowser1.Document.Forms(0).uemail.Value = Text2.Text
WebBrowser1.Document.Forms(0).psword.Value = Text3.Text
WebBrowser1.Document.Form(0).submit
hasLogged = True
Loop
Not the most efficient but if it loops because of this sub this should stop it.
cjqp
-
Apr 8th, 2004, 10:18 PM
#7
Lively Member
i tryed doing this but i get this error
Run-time error '438':
Object doesn't support this property or method
and it highlights this line below:
WebBrowser1.Document.Form(0).submit
may someone help me on this?
Julie Luvs

-
Apr 8th, 2004, 10:34 PM
#8
Frenzied Member
Try using Forms with an s at the end.
We miss you, friend...  Rest in Peace, we will take care of the rest of it.
[vbcode]
On Error Me.Fault = False
[/vbcode]
- Silence is the human way to share ignorance
Tec-Nico
-
Apr 8th, 2004, 10:36 PM
#9
Frenzied Member
Here, like this:
VB Code:
WebBrowser1.Document.Forms(0).submit
We miss you, friend...  Rest in Peace, we will take care of the rest of it.
[vbcode]
On Error Me.Fault = False
[/vbcode]
- Silence is the human way to share ignorance
Tec-Nico
-
Apr 8th, 2004, 10:38 PM
#10
Lively Member
same error
Julie Luvs

-
Apr 8th, 2004, 10:50 PM
#11
Lively Member
hm.. its strange becasue it works for mail.yahoo.com, but not the site i want to work on
Julie Luvs

-
Apr 8th, 2004, 10:52 PM
#12
Frenzied Member
Yeah, it works for me too... Strange.
I don't know the reason. Sorry
We miss you, friend...  Rest in Peace, we will take care of the rest of it.
[vbcode]
On Error Me.Fault = False
[/vbcode]
- Silence is the human way to share ignorance
Tec-Nico
-
Apr 8th, 2004, 10:54 PM
#13
Lively Member
its ok thank you for helping me tho
Julie Luvs

-
Apr 8th, 2004, 10:59 PM
#14
Frenzied Member
We miss you, friend...  Rest in Peace, we will take care of the rest of it.
[vbcode]
On Error Me.Fault = False
[/vbcode]
- Silence is the human way to share ignorance
Tec-Nico
-
Apr 8th, 2004, 11:03 PM
#15
-
Apr 29th, 2004, 01:05 PM
#16
New Member
did you try adding the action to the submit?
VB Code:
WebBrowser1.Document.Forms(0).uname.Value = Text1.Text
WebBrowser1.Document.Forms(0).uemail.Value = Text2.Text
WebBrowser1.Document.Forms(0).psword.Value = Text2.Text
WebBrowser1.Document.Forms(0).submit.Click
Last edited by memikeos; May 5th, 2004 at 07:24 AM.
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
|