Zend Zend - 6 months ago 152
HTML Question

Input field for bank account number

I need to create form input field for inputing bank account number. Than number has

max
= 18 number and
min
18 numbers.

algorithm is next (3+13+2)

So i cant use clasic input text box i need special text box where i will have slash that separates that numbers like on screenshot:

enter image description here

How can i create textbox like above using
javascript
and
html

Answer

This is very similar to this question: How to implement an input with a mask

The selected answer includes a link to a jQuery plugin that would work like this for your example:

$(function(){
    $("#field").mask("999 - 9999999999999 - 99");
});

Of course javascript can't solve everything and inputs should be validated server side as well.