It’s all beginning to feel like a joke…
All I want to do is to put the cursor, nice and blinking, in a textbox by default when a user enters the page. I know you have to make a javascript for it, since we’re talking about a server-side executed webpage. So I did, and this short code did the trick (called from Page_Load) – in Internet Explorer, but NOT in Firefox:
protected void FocusToInput(TextBox textbox)
{
if (!Page.IsClientScriptBlockRegistered("FocusToInput"))
{
Page.RegisterStartupScript("FocusToInput",
"");
}
}
Then, in search of an answer, I read something about Firefox and that it uses the w3c dom, not the IE proprietary dom (.all collection). Therefore I used the example brought with that comment, which looks the following:
And I also tried it from codebehind, like the semi-working code above. But neither of them works. There’re no errors, but it doesn’t work anyway.
BUT, the interesting part is that I tried the code (the one with the
protected void FocusToInput(TextBox textbox) { if (!Page.IsClientScriptBlockRegistered("FocusToInput")) { Page.RegisterStartupScript("FocusToInput", ""); } }
Then, in search of an answer, I read something about Firefox and that it uses the w3c dom, not the IE proprietary dom (.all collection). Therefore I used the example brought with that comment, which looks the following: