Focus on textbox based on URL.
- by Cameron
I have two forms on one page and want to have the input boxes focused based on the URL.
So for example: domain.com/Default.aspx#login and domain.com/Default.aspx#register
and the javascript I have this:
window.document.getElementById('<%=txtUserName.ClientID %>').focus();
window.document.getElementById('<%=txtEmail.ClientID %>').focus();
it might be better if the urls are Default.aspx?action=login actually (not sure if this effects the way in which it would work)