| | |
How to click a 'show more' label with vb which has a embedded java script
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2009
Posts: 10
Reputation:
Solved Threads: 0
[code=html]
This is the html of that page. I am looking forward to clicking on 'show more'
I am using a instance of Ie to open this page, As this is supposed to back end process I can't use sendkey
Any other way to get around?
VB.NET Syntax (Toggle Plain Text)
<A class=F11 id=moreFF4Link style="DISPLAY: inline" onclick="showMoreFF4('on');clickTrackSwbdAttr('BP:Attributes:Additional Info:Show More','Trattoria-Pizzeria-Roma Inc','Pizza Restaurants, Restaurant Management & Consultants')" href="javascript:void(0);"><BR>Show More ></A>
This is the html of that page. I am looking forward to clicking on 'show more'
I am using a instance of Ie to open this page, As this is supposed to back end process I can't use sendkey
Any other way to get around?
•
•
•
•
Any other way to get around?
Here's your (simplified and modified) HTML
VB.NET Syntax (Toggle Plain Text)
<html> <script> function showMoreFF4() { alert('foo'); } </script> <body> <A id=moreFF4Link style="DISPLAY: inline" onclick="showMoreFF4()" href="javascript:return(0);"><BR>Show More ></A> </body> </html>
VB.NET Syntax (Toggle Plain Text)
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ' Load test page WebBrowser1.Navigate("http://127.0.0.1/test.html") End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' Dim Link As HtmlElement ' Get element Link = WebBrowser1.Document.GetElementById("moreFF4Link") ' Found? If Link IsNot Nothing Then ' Call method Link.InvokeMember("onclick") End If End Sub
HTH
Teme64 @ Windows Developer Blog
•
•
Join Date: May 2009
Posts: 10
Reputation:
Solved Threads: 0
The query was for vb and not vb.net.
There's some problem with this loop
it gives an error 424: object required
and yah i can't find htmlelement in vb and hece used htmlanchorelement
Thanks for help
There's some problem with this loop
visual basic Syntax (Toggle Plain Text)
If Link IsNot Nothing Then ' Call method Link.InvokeMember("onclick") End If
it gives an error 424: object required
and yah i can't find htmlelement in vb and hece used htmlanchorelement
Thanks for help
•
•
•
•
The query was for vb and not vb.net.
•
•
•
•
There's some problem with this loop

•
•
•
•
it gives an error 424: object required
If Link IsNot Nothing Then to ensure that Link variable is an object. So it must be InvokeMember("onclick") part that causes the error. That method doesn't produce an error even if the member (onclick in this case) isn't found. It seems that you've slightly modified the code and run it with VB6, am I right?
Teme64 @ Windows Developer Blog
•
•
Join Date: May 2009
Posts: 10
Reputation:
Solved Threads: 0
for counter=1 to 3
print ("sorry")
next
1) I can't find a vb forum here
2) as you would have already known, am a beginner and was out of my mind then
3)
so you're right the problem is with
any solutions.....!!!!
print ("sorry")
next
1) I can't find a vb forum here
2) as you would have already known, am a beginner and was out of my mind then
3)
If Link IsNot Nothing Then was giving a error as invalid use of property so removed it,so you're right the problem is with
InvokeMember("onclick") any solutions.....!!!!
•
•
•
•
I can't find a vb forum here
•
•
•
•
as you would have already known, am a beginner and was out of my mind then

•
•
•
•
any solutions.....!!!!
I still have VB6 installed so I took a quick look, but I didn't find any solution with VB6, sorry!
Teme64 @ Windows Developer Blog
![]() |
Similar Threads
- I have a form and it is not calling my java script function WHY? (JavaScript / DHTML / AJAX)
- Simple Java Script Question (JavaScript / DHTML / AJAX)
- java script help for making webpage sample.? (JavaScript / DHTML / AJAX)
- Java script errors with IE & Mozilla (Web Browsers)
- Please help me to Print Layer content from Java Script (JavaScript / DHTML / AJAX)
- Email validation using java script (JavaScript / DHTML / AJAX)
- How to Embed CheckList Box on HTML Page using Java Script (HTML and CSS)
- A question on java script?(Please answer ASAP) (Java)
- java script for main menu (ASP)
Other Threads in the VB.NET Forum
- Previous Thread: Checkbox in Datagrid has to click twice to uncheck.
- Next Thread: Playing mp3's
| Thread Tools | Search this Thread |
.net .net2008 2008 access add advanced application array basic beginner browser button buttons center click code combo cpu cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic employees excel exists fade filter forms generatetags html images input intel internet listview map mobile module monitor msaccess mysql net number objects open pan panel pdf picturebox picturebox2 port position print printing printpreview regex remove reuse right-to-left save search searchvb.net serial settings shutdown socket sqldatbase sqlserver storedprocedure survey temperature textbox timer timespan transparency txttoxmlconverter user usercontol vb vb.net vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web winforms wpf wrapingcode xml year





