I want to allow the user to input only Khmer character (Unicode character) and raise an alert if otherwise.
Khmer Name: <input type="text" class="namekh" name="namekh">
In order to do so, my sample script is like this:
<script>
var namekh = $('.namekh').val();
// function to check unicode or not
if (isUnicodeFunc(namekh) == true) {
alert('unicode character');
} else {
alert('please enter unicode only');
}
</script>
How can I define function isUnicodeFunc
to detect if the value is Unicode or not?