?
Solved

hit enter after entered data in a website form

Posted on 2006-04-28
10
Medium Priority
?
180 Views
Last Modified: 2010-04-23
hello,
Im having a hard time with a website, im trying to submit the data
with enter or clicking the submit button, but I can get it done.
im able to put the data into the yext fields this is what i have

        Call WebBrowser1.Navigate(New System.Uri("http://www.myspacetrain.com/join2.php"))

        For i = 1 To 100
            Sleep((100))
            System.Windows.Forms.Application.DoEvents()
        Next

        With WebBrowser1.Document.DomDocument
            txtOne = .GetElementsByName("friendID")(0)
            txtTwo = .GetElementsByName("name")(0)

            txtOne.Value = "12345678"
            txtTwo.Value = "hello"
            .Forms(0).submit() ' this is not working right
        End With

        For i = 1 To 100
            Sleep((100))
            System.Windows.Forms.Application.DoEvents()
        Next
0
Comment
Question by:aplelois
10 Comments
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 400 total points
ID: 16560960
Hi aplelois,

have you tried:
WebBrowser1.Document.Forms(0).submit()

Cheers!
0
 

Author Comment

by:aplelois
ID: 16561046
not working and I get this message
Error      2      'submit' is not a member of 'System.Windows.Forms.HtmlElement'.      
0
 
LVL 3

Assisted Solution

by:Kudzullc
Kudzullc earned 1200 total points
ID: 16561618
aplelois ,

hmmm...  Are you trying to send and receive over an Http connection?  If so, try using HttpRequest.  You can use this to pass information in the  url into the php code.  I do something very similar in a project i am using now.  I used VB.NET to build a string (url) and request the page in the back ground.  My services are through a Coldfusion file.  But, the same idea can be used for php.

Lucas
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 400 total points
ID: 16566922
What .NET version are you using?  It looks like 2005?

Bob
0
 

Author Comment

by:aplelois
ID: 16567149
net framework v2.0.50727
vb.net v8.0.50727
0
 

Author Comment

by:aplelois
ID: 16567347
I even tried thiis but is not working either
WebBrowser1.Document.DomDocument.Forms("0").submit()
0
 
LVL 3

Accepted Solution

by:
Kudzullc earned 1200 total points
ID: 16576904
aplelois,

I was just looking at the source code for the website you are trying to submit information to.  

<form action="post_bulletin.php" method="POST" target="_top">

In most Javascript and HTML i have seen, if you are going to call submit from outside an input button thats labeled type="submit".  You must explicitly call the form by name

like this...

<form action="post_bulletin.php" method="POST" target="_top" name="formname">

WebBrowser1.Document.DomDocument.formname.submit()

I am not sure the code above is correct, if following normal parameters for javascript, you would call submit like this

document.formname.submit()

this line in javascript is how to submit a form without an input type="submit"

gl,
Lucas
0
 
LVL 3

Expert Comment

by:Kudzullc
ID: 16576922
<form action="post_bulletin.php" method="POST" target="_top">

<table border=0 align="center" width="300">

<tr>
<td class="main">Friend ID: [ <a href="http://myspacetrain.com/friendid.php" target="blank"><font style="color:990000; font-family:Arial, Helvetica, sans-serif; font-size:13px">?</font></a>]
</td>

<td>                            <input type="text" name="friendID" maxlength="9" />
</td>
</tr>
<tr>
<td class="main">Display Name:</td>

<td>                            <input type="text" name="name" maxlength="15" />
</td>
</tr>

</table>

<input name="submit" type="submit" class="button" value="Jump on the train!" />

</form>

this is the html source i see.

hope this helps,

Lucas
0
 

Author Comment

by:aplelois
ID: 16577139
ok, I just want to be able to submit that form, I tried your way but I didnt work. is there a way to submit it?
0
 
LVL 3

Expert Comment

by:Kudzullc
ID: 16577259
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question