Hello!
I would like to set the focus to the first text input element.
I am using this code:
Quote: 'and the following Javascript-injection ensures, that the first
'found input-element (if there is one) will be focused
i = i + 1 : JS(i) = "<script>"
i = i + 1 : JS(i) = "var inputElements = document.getElementsByTagName('input');"
i = i + 1 : JS(i) = "for(i=0; i<inputElements.length; i++)"
i = i + 1 : JS(i) = "{"
i = i + 1 : JS(i) = " if (inputElements[i].type != 'hidden')"
i = i + 1 : JS(i) = " {"
i = i + 1 : JS(i) = " if (inputElements[i].disabled == false)"
i = i + 1 : JS(i) = " {"
i = i + 1 : JS(i) = " inputElements[i].focus();"
i = i + 1 : JS(i) = " inputElements[i].scrollIntoView(true);"
i = i + 1 : JS(i) = " break;"
i = i + 1 : JS(i) = " }"
i = i + 1 : JS(i) = " }"
i = i + 1 : JS(i) = "}"
i = i + 1 : JS(i) = "</script>"
_Browser.WebView.EvalScript(Join(JS))
However, nothing happens.
Can anybody tell me what I am doing wrong?
I think my javascript code is correct, so I think "EvalScript" is perhaps not the right method.
Thank you for the help.