Question selecting combobox on webbrowser control

knowmeifyou

Active member
Joined
Jun 16, 2013
Messages
26
Programming Experience
Beginner
here is the website
VB.NET:
http://www.afreesms.com/freesms
here is my codes
VB.NET:
using vb.net and webbrowser control
wb name of my webbrowser control
to select item on combobox and its working
VB.NET:
Try
                Dim element As HtmlElement = wb.Document.GetElementById("countrycode")
                Dim month As HtmlElement = element.GetElementsByTagName("option").Cast(Of HtmlElement).First(Function(el) el.GetAttribute("value") = "PH")
                month.SetAttribute("selected", "true")
            Catch ex As Exception
                MsgBox(ex.StackTrace)
            End Try


here is the output


1.png


but using a webbrowser installed on pc i get this result

2.png

the problem is when using my program. it doesnt hide the
VB.NET:
sender id: country code: and mobile number


and it doesnt add the country code + 63 below the combo box after choosing the country


any idea guys? what additional codes i need to add on my codes
 
You need to get the object that is the submit button.
VB.NET:
Dim btnSubmit As HtmlElement
'The submit button's ID  is "submit" on this page.
btnSubmit = wb.GetElementById("submit")
'If you have the button object, then click it.
If (btnSubmit IsNot Nothing) Then
    btnSubmit.InvokeMember("click")
End If
 
doesnt work. it says "an Unknown error has occured"

the same error with the codes i tried. but it shows the javascript working to send the message. just like on google chrome but before sending the message it hangs then gives me the error
 
using this codes

Document.GetElementById("Submit").RaiseEvent("onclick")

runs the javascript but it doesnt send. the javascript says "now sending..... Please wait" lol. its been 15 minutes. but it doesnt send the message
 
I don't know what problem you are having because you have not provided any code. Debugging the code is something that must be done within your own code. I can't determine what the problem is because you have refused to provide anything I can work with. "It doesn't work" does not help me resolve your problem. The code I provided absolutely works in a webbrowser control that I have in a project that I tested it in. I don't know what you are doing wrong or what you are doing different, but I can't help you because I just don't know.
 
ive done all the necessary stuff like adding text. or whatsoever

but my problem is how do i click a button. and i think its a javascript stuff
im using this codes
WebBrowser1.document.All("Submit").RaiseEvent("onclick")
i think the code above is working but doesn't send the message

it keeps hanging and show me a javascript working and it says "Now sending... Please wait"

Kindly help me. and thanks a lot
 
Back
Top