For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!
Javascript var input= getelementbyid() then input.focus() is not working
User, tell us your exact jdev version, please! What is an amx page?
In general, getelementbyid without a parameter (the id) can't work.
Timo
Thank you for your fast answer . Jdeveloper version is 12.2.1.3. The amx page is a test MAF amx page used to test how to set focus (blinking cursor) to inputText whose id is it1. So im calling a javascript with the following code:
var input= document.getElementbyId(“it1”); input.focus(); it doesn’t work.
~I moved the question over to the MAF category.~ Moved the post back to JDev&ADF as the MAF category can't be accessed by normal users.
Have you checked that your function is finding the inputText? Do you see the right data in your alert? I'm not sure if this works for MAF but in ADF you can do it like shown here https://blogs.oracle.com/jdevotnharvest/how-to-programmatically-set-focus-on-an-input-component
the issue is solved by using var input =document.getElementById("it1__inputElement"); instead of var input =document.getElementById("it1");
Thanks