You need to sign in to do that
Don't have an account?
Set focus on a control on visualforce page load through controller class
Hi...
I am trying to set focus to a specified textbox through its controller class(as it is requirement) ...
For this in asp we have like "Page.RegisterStartupScript()"...
for eg..
private void SetFocus(String controlID)
{
// Build the JavaScript String
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script language='javascript'>");
sb.Append("document.getElementById('");
sb.Append(controlID);
sb.Append("').focus()");
sb.Append("</script>")
// Register the script code with the page.
Page.RegisterStartupScript("FocusScript", sb.ToString());
}
Is there any method in apex in Force.com to register a javascript on current page through apex code...
please reply asap...
Thank you!!!
Hi....
I get the solution....
anyways...
thanks...
Hi Can you please share the solution u got.