Validate Input Text In Javascript Object To String