I am using java-script in my application and i am in the middle of a bizarre situation.
I have used the below code in my page.
The problem that I am facing is after the setFocus() function is called the other function rendersection() is not called. But when i remove the setFocus() and then try, then the rendersection() is called. As seen in the above code i have also tried giving the rendersection() before the setFocus(). still it does not work. Does anyone know if i am missing anything here?
Also, when i tried to change the setFocus() to something different like putFocus or getFocus the function is called but the focus is not set to the desired field
Michael Matola wrote:Believe it or not, that id appears to be valid.
Oh, yes, it is technically legal (though insane) -- sorry for not being clear -- but to me it looks like server-side markup and so I'm not convinced that it's really the right id and the method is actually finding anything.
Joined: Dec 07, 2010
sorry... I should have a bit more clearer. The js script i have shared here is used in a tool(or a platform) so the bizarre id. The id means that I am referring to an object(element) inside a page block with the id 'thePageBlock' and an element with the id 'state'. The setFocus() function works fine. It sets the focus to the correct element.
As for the error, I am not getting any in my console.