Validate Input Text In Javascript Object Methods