0

When I try to submit form in ChromiumWebBrowser (CefSharp c# winforms) using this simple code:

 browser.EvaluateScriptAsync("document.getElementsByName('username')[0].value = '" + login + "';");
 browser.EvaluateScriptAsync("document.getElementsByName('password')[0].value = '" + pass + "';");

 browser.ExecuteScriptAsync("document.getElementsByClassName('sb-frap')[0].click()");

I get something like this:

image1

But when submit I get this:

image2

is there any JavaScript event I have to call to make this work?

Prix
  • 19,417
  • 15
  • 73
  • 132
S.Wael
  • 1
  • 1
  • 1
  • The only generic solution is to simulate key input which is white complex. The simple option is likely to execute some JavaScript to remove the validation. You'll have to work that part out for yourself – amaitland Feb 23 '18 at 01:25
  • Do you know what javascript event i have to execute? source code show me that input field have event invalid() i used it but nothing happen , the same problem ( do i have to pass data to the script invalid() ?? ) – S.Wael Feb 23 '18 at 10:40
  • It's different for every framework, so it's really on you to work out. – amaitland Feb 23 '18 at 23:29

0 Answers0