Split String Into Substrings Javascript Form Submit