-
August 9th, 2011, 05:30 PM
#1
Invoking HTML?
I'm having some trouble here... I have a box that, when selected with Firebug, shows the following code:
Code:
<div class="StartBtn">
<input type="image" tabindex="8" title="Get Free Quote!" alt="Get Free Quote!" src="images/quote_btn.gif">
</div>
Is there any way I can programmatically find and invoke this object? Like maybe loop through the classes and see if it matches "StartBtn"? I know of source like:
Code:
webbrowser1.Document.GetElementByID("btn").Invoke("click");
But obviously that doesn't apply because there is no ID..?
Last edited by Silo1337; August 9th, 2011 at 05:33 PM.
-
August 10th, 2011, 01:30 AM
#2
Re: Invoking HTML?
You could perhaps look into getElementsByTagName. But, GetElementByID is actually preferred, so you would need to add the ID attribute to that image in HTML code.
Here is some info on getElementsByTagName :
http://www.google.co.uk/search?q=get...ytagname&hl=en
-
August 11th, 2011, 12:06 PM
#3
Re: Invoking HTML?
Originally Posted by HanneSThEGreaT
I had tried GEBTN a while back but wasn't actually able to get it to work. After following the link you supplied, I was able to find a site that explained it better than MSDN itself. Using the asterisk as the tagName allows me to loop through all of the elements, and now I'm simply clicking each element as it loops through. I think it works, but I'll have to do some testing.
I'm somewhat confused as to how I can assign an ID to an element unless I'm simply doing something like element.Id = ID.
Either way it goes, I appreciate the link you supplied me!
-
August 11th, 2011, 12:26 PM
#4
Re: Invoking HTML?
Originally Posted by Silo1337
I'm somewhat confused as to how I can assign an ID to an element unless I'm simply doing something like element.Id = ID.
Either way it goes, I appreciate the link you supplied me!
I'm glad I could help
You need to set the ID in the HTML code, for example :
Code:
<Img Name="whatever" Width="whatever" Height="whatever" Alt="whatever" ID="whatever"></IMG>
-
August 13th, 2011, 05:51 PM
#5
Re: Invoking HTML?
Originally Posted by HanneSThEGreaT
I'm glad I could help
You need to set the ID in the HTML code, for example :
Code:
<Img Name="whatever" Width="whatever" Height="whatever" Alt="whatever" ID="whatever"></IMG>
All right, so I've been able to solve my problem, but now I am having another. I have a report system setup on my site (can see it here: http://dontdoit.site90.com/contact/contact.html)
I don't want my users to spam me, though, and would like to have some way I could know when the submit button was clicked. The report button on my form is disabled for two minutes when it's pressed, but now I need to make sure the user can't just backspace / refresh and keep submitting information over and over.
Would there be some coding I could use to know WHEN the button is pressed so that I can simply close the report form and make the user wait two minutes before they use it again? Thanks!
-
August 14th, 2011, 03:21 AM
#6
Re: Invoking HTML?
make sure not to cache the file. look up META tags and caching
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|