validation format of javascript -
validation format of javascript -
i found these javascript validation codes:
<script type="text/javascript"> function validasi_input(form){ pola_username=/^[a-za-z0-9\_\-]{6,100}$/; if (!pola_username.test(form.username.value)){ alert ('username minimal 6 karakter dan hanya boleh huruf atau angka!'); form.username.focus(); homecoming false; } homecoming (true); } </script>
i want inquire part:
pola_username=/^[a-za-z0-9\_\-]{6,100}$/;
does can tell me how understand kind of format? format letter, or number, or characters?
/^[a-za-z0-9\_\-]{6,100}$/;
in english language means: string can have letter either uppercase or lowercase, numbers, underscores, , hyphens. minimum length of 6 characters, , maximum length of 100.
further details:
the string must start either letter, number, underscore, or hyphen.
javascript
Comments
Post a Comment