1 ) Setting the Text box to take only 12 Values.
Why dont you limit the text for size modifying <input> tage used for the text box ?
<input type="text" size="value" maxlength="12"> </input>
2) First 2 should be BA.
You can use Substring operator and string comparison to achieve this.
Initialise actualString with value BA.
if ( stringSource.substring(0,1).toString() != actualString.toString() )
{
}
3) Check the rest of the 10 digits are number.
if ( isNaN(stringSource.substring(2,11)))
{
}
You can add the above contents into one function and then set it to work for the textchanged event.
BR//
Harsha</input>