hit enter after entered data in a website form

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
apleloisAsked:
Who is Participating?
 
KudzullcCommented:
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
 
Éric MoreauSenior .Net ConsultantCommented:
Hi aplelois,

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

Cheers!
0
 
apleloisAuthor Commented:
not working and I get this message
Error      2      'submit' is not a member of 'System.Windows.Forms.HtmlElement'.      
0
Get your problem seen by more experts

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

 
KudzullcCommented:
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
 
Bob LearnedCommented:
What .NET version are you using?  It looks like 2005?

Bob
0
 
apleloisAuthor Commented:
net framework v2.0.50727
vb.net v8.0.50727
0
 
apleloisAuthor Commented:
I even tried thiis but is not working either
WebBrowser1.Document.DomDocument.Forms("0").submit()
0
 
KudzullcCommented:
<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
 
apleloisAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.