Monday 29 April 2013

Automatically Move Cursor to Next Field When Textbox Full using javascript in asp.net

JavaScript-
 
<script type="text/javascript">
function movetoNext(current, nextFieldID) {
if (current.value.length >= current.maxLength) {
document.getElementById(nextFieldID).focus();
}
}
</script>


html-

<input type="text" id="txtFirst" size="4" onkeyup="movetoNext(this, 'txtSecond')" maxlength="10" />
<input type="text" id="txtSecond" size="4" onkeyup="movetoNext(this, 'txtThird')" maxlength="10" />
<input type="text" id="txtThird" size="5" maxlength="11" />

No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...