Lets say a form has a submit button, and its text is 'Post'
(<INPUT TYPE="submit" VALUE="Post"> )
how can you submit that button by using its value?
Anyone know?
Lets say a form has a submit button, and its text is 'Post'
(<INPUT TYPE="submit" VALUE="Post"> )
how can you submit that button by using its value?
Anyone know?
VB Code:
For x = 0 To WB.Document.forms(0).elements.length If WB.Document.forms(0).elements(x).Value = "Post" Then WB.Document.forms(0).elements(x).submit() Exit For End If Next x
Something similar to that.
:)
but what if the form is not certain? like.. the post can be in form,2,3,4, or even more..
You should be able to loop through the forms, too.Quote:
Originally posted by qpabani
but what if the form is not certain? like.. the post can be in form,2,3,4, or even more..
how :)?
i dont know how many forms there are on a page.. is there a variable that contains this number?
Maybe something like this:
VB Code:
Dim x as Long Dim y as Long For y = 0 To WB.Document.forms.length - 1 For x = 0 To WB.Document.forms(y).elements.length - 1 If WB.Document.forms(y).elements(x).Value = "Post" Then WB.Document.forms(y).elements(x).submit() Exit For End If Next x Next y
yay it looks good :)
gonna try it now on my brand spankin new visual studio.net :P
Try changing this line:
WebBrowser1(0).Document.Forms(y).elements(x).submit
------To this line------
WebBrowser1(0).Document.Forms(y).submit
-OR-
Try using "Click" instead of "submit"
WebBrowser1(0).Document.Forms(y).elements(x).Click
thanks bloodeye..
how do you know sooo much about dhtml/webbrowser control?
youre a genius ! :D