WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button
Go Back  Xtreme Visual Basic Talk > > > WebBrowser1 Auto Click A Button


Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2011, 12:12 PM
Jimmyx1000 Jimmyx1000 is offline
Newcomer
 
Join Date: Aug 2004
Posts: 8
Default WebBrowser1 Auto Click A Button


HI,

In Vb6 WebBrowser1 Control i am trying to click a button automatically

However the button does not have a "button name" just a label of "Edit"

now there are 2 of these forms/buttons on the same page

if i do the following command it clicks form2 "Edit" and misses form1 "Edit"
so it goes to page 2 rather than clicking the first "Edit" for page1.

here is the code i am using and the code below is of the 2 forms

For X = 0 To WebBrowser1.Document.Forms.length - 1

For i = 0 To WebBrowser1.Document.Forms(X).length - 1

If WebBrowser1.Document.Forms(X)(i).Value = "Edit" Then
WebBrowser1.Document.Forms(X)(i).Click
End If

Next i

Next X



1st form

'<form action='/accounts/' method='post' id='server_form_9d32bebd_2a94_4dad_9ae8_01b8e7022814' name='server_form_9d32bebd_2a94_4dad_9ae8_01b8e7022814' onsubmit='x=server_form_9d32bebd_2a94_4dad_9ae8_01b8e7022814; x.delete_server.disabled=true; x.start_server.disabled=true;'>
'<input type='hidden' id='uuid' name='uuid' value='9d32bebd-2a94-4dad-9ae8-01b8e7022814'/>
'<input type='hidden' id='form' name='form' value='stopped_server'/>
'<input type='hidden' value='' id='start_server_check' name='start_server_check'/>
'<input type='hidden' value='' id='delete_server_check' name='delete_server_check'/>
'<input type='submit' id='start_server' name='start_server' value='Start' onclick='x=server_form_9d32bebd_2a94_4dad_9ae8_01b8e7022814; x.start_server_check.value="start_server"; x.start_server.value="Processing...";'/>
'<input type='button' value='Edit' onclick='location.href="/accounts/config/9d32bebd-2a94-4dad-9ae8-01b8e7022814"'/>
'<input type='submit' id='delete_server' name='delete_server' value='Delete' onclick='if (confirm("Are you sure that you want to permanently delete this server?")) { x=server_form_9d32bebd_2a94_4dad_9ae8_01b8e7022814; x.delete_server_check.value="delete_server"; x.delete_server.value="Processing..."; return true; } else { return false; }'/>
'</form>







2nd form

'<form action='/accounts/' method='post' id='drive_destroy_form_64148a89_a782_4335_b62a_9dad3b857705' name='drive_destroy_form_64148a89_a782_4335_b62a_9dad3b857705' onsubmit='x=drive_destroy_form_64148a89_a782_4335_b62a_9dad3b857705; x.delete_drive.disabled=true; x.copy_drive.disabled=true;'>
'<input type='hidden' id='uuid' name='uuid' value='64148a89-a782-4335-b62a-9dad3b857705'/>
'<input type='hidden' id='form' name='form' value='drive_action'/>
'<input type='button' value='Edit' onclick='location.href="/accounts/drive/64148a89-a782-4335-b62a-9dad3b857705"'/>
'<input type='hidden' value='' id='copy_drive_check' name='copy_drive_check'/>
'<input type='hidden' value='' id='delete_drive_check' name='delete_drive_check'/>

<input type='submit' value='Copy' id='copy_drive' name='copy_drive' onclick='x=drive_destroy_form_64148a89_a782_4335_b62a_9dad3b857705; x.copy_drive_check.value="copy_drive"; x.copy_drive.value="Processing...";'/>


<input type='submit' value='Delete' id='delete_drive' name='delete_drive' onclick='if (confirm("Are you sure that you want to permanently delete this drive and all data stored on it?")) { x=drive_destroy_form_64148a89_a782_4335_b62a_9dad3b857705; x.delete_drive_check.value="delete_drive"; x.delete_drive.value="Processing..."; return true; } else { return false; }'/>

</form>
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button
 
WebBrowser1 Auto Click A Button
WebBrowser1 Auto Click A Button
 
-->