This is my code:
webBrowser1.Document.GetElementById("user").SetAttribute("value", txtUsername.Text);
webBrowser1.Document.GetElementById("pass").SetAttribute("value", txtPassword.Text);
webBrowser1.Document.GetElementById("rememberme").SetAttribute("checked", cbAutoLogin.Checked.ToString());
The username and password is ok I don't have any problem, but the check is not working. The problem is not on the cbAutoLogin.Checked.ToString(), even if I write true or false nothing change.
Here is the checkbox on html
<input type='checkbox' id='rememberme' checked='checked' name='rememberme' value='1' class='input_check' />
Anyone else have the same problem? Or I do something wrong?
Use this:
webBrowser1.Document.GetElementById("rememberme").InvokeMember("CLICK");
It will make it checked if unchecked and Unchecked if Checked.
OR change the value attribute same like username,password to 0 or 1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With