how to restrict input in javascript