Technically speaking, the Pig Latin rules that we have established apply only to words, not phrases. However, your current piglatin.html page does nothing to prevent users from entering a string containing spaces. Thus, a user could enter "foo bar" in the text box and be told that the Pig Latin translation is "oo barfay".
Modify your PigLatin function so that, before the string is translated, the function checks whether the input is a single word (i.e. whether it contains any spaces). If there are spaces in the input, the function should return the string "ILLEGAL INPUT".© BrainMass Inc. brainmass.com October 9, 2019, 9:48 pm ad1c9bdddf
This solution involves writing a function that will translate words to Pig Latin.