-
Help with web forms
Hi So i am trying to make a program that registers and account on a website and i am having a few problems, first ill post my code:
Code:
WebBrowser1.Document.GetElementById("date_month").InnerText = ComboBox1.Text
WebBrowser1.Document.GetElementById("date_day").InnerText = ComboBox2.Text
WebBrowser1.Document.GetElementById("date_year").InnerText = TextBox1.Text
WebBrowser1.Document.GetElementById("login").InnerText = TextBox2.Text
WebBrowser1.Document.GetElementById("character_name").InnerText = TextBox3.Text
WebBrowser1.Document.GetElementById("password").InnerText = TextBox4.Text
WebBrowser1.Document.GetElementById("confirm").InnerText = TextBox5.Text
WebBrowser1.Document.GetElementById("email").InnerText = TextBox6.Text
Here are my problems:
1. When i inpute the month, it doesnt input it, it just makes the combobox on the website smaller for some reason
2. I cant get the email working because you must put your birhtday before it shows where to put your email, obviously fixing the first problem should fix this.
3. There are 2 radiobuttons on the website, for a boy and a girl and I have 2 radiobuttons in my form, however I have exactly no idea how to program it to change.
Your help is greatly appreciated.
-
Re: Help with web forms
-
Re: Help with web forms
this has been asked a number of times....
http://www.vbforums.com/showthread.p...=fill+web+form
searching the forums for "fill web form" turned up a lot of threads. So you don't waste your time, I think the first one that will be of some use is: VS 2010 Web Browser - Auto Fill In started by Noximana
-tg
-
Re: Help with web forms
This still doesnt answer my question about the drop-down menu/combobox.
-
Re: Help with web forms
you need to be setting the value of the item once you have it... not the innertext.
as in this example:
WebBrowser1.Document.DomDocument.GetElementById("username").Value = TextBox1.Text
and this one:
WebBrowser1.Document.All("vb_login_username").Value = TextBox1.Text
and I appologize... I meant to post the link to the search results page... not to a specific thread.
-tg
-
Re: Help with web forms
Ok edit I got those working, now just the radio buttons
Im using this code:
If RadioButton1.Checked = True Then
DirectCast(GetCurrentWebForm.item("character_gender", 1), mshtml.HTMLOptionButtonElement).checked = True
Else
DirectCast(GetCurrentWebForm.item("character_gender", 0), mshtml.HTMLOptionButtonElement).checked = True
End If
But I get these errors:
GetCurrentWebForm is not declared
Type 'mshtml.HTMLOptionButtonElement' is not defined.
-
Re: Help with web forms
-
Re: Help with web forms