text validation codes in javascript