CTpaHrep
8th September 2014, 06:04
Hello folks.
I have the HTML form in QWebView loaded. This HTML has following two elements:
<button class="submit1" tabindex="1" type="submit" id="submit1">accept</butto
<button class="submit2" tabindex="2" type="submit" id="submit2">decline</button>
In code I have follwing:
QWebView webView;
...
QWebElement button = webView->page()->mainFrame()->documentElement().findFirst("button[id=\"submit1\"]");
button.evaluateJavaScript("this.click();");
And this last line of code don't work for me.
Moreover if I have an <input> element instead of button - JavaScript click() method works fine
I have the HTML form in QWebView loaded. This HTML has following two elements:
<button class="submit1" tabindex="1" type="submit" id="submit1">accept</butto
<button class="submit2" tabindex="2" type="submit" id="submit2">decline</button>
In code I have follwing:
QWebView webView;
...
QWebElement button = webView->page()->mainFrame()->documentElement().findFirst("button[id=\"submit1\"]");
button.evaluateJavaScript("this.click();");
And this last line of code don't work for me.
Moreover if I have an <input> element instead of button - JavaScript click() method works fine