simpleonline123 0 Newbie Poster

Need help with logging into a particular website using the GetElementby command

As far as the username/password it seems to be working find but there isn't an ID or Tag for me to use in my script to click on this particular button called "submit". Looks like the page is using an class for the button. How can I write the code to get the element by the class? The area is the javascript:void(0).

Here is the source from the site (it's zoomed into the actual area I need to click on):

<ul>
					<li class="submit first iefix"><a class="submit btnWhite" href="[B]javascript:void(0)[/B];">Add a site &gt;</a></li>
					<li><a class="cancel" href="javascript:void(0);">Cancel</a></li>
					<li class="sticky last">

						<label class="checkbox">
							<input type="checkbox" name="sticky" value="" id="sticky" />
							Sticky

Here is my code that I have so far:

//Login: username
//Password: passwordLogin: login
//login button: login-submit

         
            {
                              
                webBrowser1.Document.GetElementById("username").SetAttribute("value", textBox1.Text);
                webBrowser1.Document.GetElementById("password").SetAttribute("value", textBox2.Text);
                webBrowser1.Document.GetElementById("login-submit").InvokeMember("click");
             
           

            


                bEnteredInfo = true;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.