This is client-side, so you have to use ECMAScript (you might call it
JavaScript)...
Here's a sample...
<input id="txtPhone1" maxlength="3"/>
<input id="txtPhone2" maxlength="3"/>
<input id="txtPhone3" maxlength="4"/>
var txtPhone1Obj;
var txtPhone2Obj;
var txtPhone3Obj;
window.onload = function(evt) {
txtPhone1Obj = document.getElementById('txtPhone1');
txtPhone2Obj = document.getElementById('txtPhone2');
txtPhone3Obj = document.getElementById('txtPhone3');
txtPhone1Obj.onkeypress = function(evt) {
if(txtPhone1Obj.value.length == txtPhone1Obj.maxLength) {
txtPhone2Obj.focus( );
}
};
txtPhone2Obj.onkeypress = function(evt) {
if(txtPhone2Obj.value.length == txtPhone2Obj.maxLength) {
txtPhone3Obj.focus( );
}
}
}
This meets all the requirements for being legal for use on the public
Internet: it's standard. More importantly, it's therefore future
proof.
David Betz
http://davidbetz.net/dynamicbliss/ http://davidbetz.net/winfx/