Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use VB6 WebBrowser to call a button without NAME attribute on HTML??

Status
Not open for further replies.

mingichu

MIS
Apr 12, 2002
29
US
Hi! All experts,

I use VB6 WebBrowser to pass search strings from a text file and and get results on the web. At the end of my procedure ProcessCT(), I need to call the button "Sign-off of the Concord system" on the result page (page 3). I couldn't find the NAME or any function for that button from the HTML source codes:

<FORM ACTION="/servlet/TerminalServlet" METHOD="POST">
<INPUT TYPE="hidden" NAME="request" VALUE="disconnect">
<INPUT TYPE="submit" VALUE="Sign-off of the Concord system">
</FORM>


Not quite familiar with web language....
Please help!!! Thanks in advance!!

Below are my VB6 codes. The HTML above is on the page 3 of my procedure.
======================================
Public Sub ProcessCT()
frmWB.wb.Navigate2 " Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
Call frmWB.wb.Document.parentWindow.execScript _
("MM_swapImage('document.layers[\'Logo\'].document.Logo','document.Logo','images/ConcordButton.gif','#932951425980')", "JavaScript")
frmWB.wb.Navigate2 " Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop

'page 1
frmWB.wb.Document.All("13").Value = "1"
frmWB.wb.Document.All("DFH_ENTER").Click
Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop

'page 2
frmWB.wb.Document.All("13").Value = "1"
frmWB.wb.Document.All("DFH_ENTER").Click
Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop

'page 3
frmWB.wb.Document.All("14").Value = lBusSrcName
frmWB.wb.Document.All("DFH_ENTER").Click
Do Until frmWB.wb.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
'...........

''''' HERE I WANT TO CLICK "Sign-off the Concord System" button

End Sub
======================================
 
You need to post the form, instead of click on the button, using code. Try something along the lines of :
frmWb.wb.Document.Form.Submit or Post.

I haven't got access to my work PC at the moment, but I'll try and post the correct code later.

BB
 

something like
[tt]
wb.Document.All("submit").Click
[/tt]

Good Luck

 
Hi, vb5prgrmr,

I modified the codes and it worked:

Call frmWB.wb.Document.Forms(1).submit

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top