Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
move focus from one textbox to another in javascript with server tags there are many eg available on google but without server tags that is not applicable for me !!
Posted
Updated 10-Mar-14 21:46pm
v3
Comments
Raajkumar.b 11-Mar-14 2:23am    
hi,try this
<script type="text/javascript">
function movetoNext(current, nextFieldID) {
if (document.getElementById(current).value.length >= document.getElementById(current).maxLength) {
if (document.getElementById(nextFieldID) != null) {
document.getElementById(nextFieldID).focus();
}
}
}
</script>
Khan Sameer 12-Mar-14 2:39am    
thnks a lot it works !!!
Raajkumar.b 12-Mar-14 6:16am    
mark it as correct answer

XML
If you do not have ClientIDMode = static then you will need to use ClientID

$('#<%= txt1.Client %>').focus();
 
Share this answer
 
XML
hi,try this
<script type="text/javascript">
    function movetoNext(current, nextFieldID) {
        if (document.getElementById(current).value.length >= document.getElementById(current).maxLength) {
            if (document.getElementById(nextFieldID) != null) {
                document.getElementById(nextFieldID).focus();
            }
        }
    }
    </script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900