Validate Input Text In Javascript Object Sorting In Javascript