Convert Text to ASCII values (Part 2)

Students will create a utility that converts text to its equivalent ASCII codes. Users will be
instructed to enter one English word. When they execute the function, they will see their text
changed into ASCII digits separated by commas. For example, the word 'hello' will become
104,101,108,108,111. The conversion should work for any English lower case word.

Required structures and tools:
 Switch/Case
 Array (For this exercise, students may use the JavaScript "split" function to populate the
array).
 Custom function
 Loops
 Error handling

Restriction: Students may not use JavaScript conversion functions such as "CharCodeAt".

This is what I have but not sure why it isnt giving me the values in switch case after I split them. I must be missing something.

Code:
<!DOCTYPE html>
<html>
	--><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

	<script>
		//This is a function that serves as the base to convert the letter to ascii.
		function convertlettertoascii()
		{
			//Set up variables.
			var userinputtext;
			var letterMessage;
			var charArray;
			
			//Get the letter from the user and assign it to a variable.
			userinputtext = window.prompt("Please enter a lower case letter a-z.","Enter letter here.");
			charArray = userinputtext.split("");
				//initialize the display variable with an empty string.
				displayText = "";
		
				//Loop through the array, concatenating each character to the display variable with a comma.
				for(i=0; i < charArray.length; i++)
				{
					displayText = displayText + charArray[i] + ", ";
				}
			
				//Display the results
				ShowOnScreen(displayText);

		}

		//This function performs the letter choice.
		
			//set up variables
			var returnascii;
			var convertoasciiBase = "Your letter is the following in ascii: ";
   // this is based on what the user selected and will display the results
			switch(userinputtext)
			{
				case "a":
					returnascii = convertoasciiBase + "97";
					break;
				case "b":
					returnascii = convertoasciiBase + "98";
					break;
				case "c":
					returnascii = convertoasciiBase + "99";
					break;
				case "d":
					returnascii = convertoasciiBase + "100";
					break;
				case "e":
					returnascii = convertoasciiBase + "101";
					break;
				case "f":
					returnascii = convertoasciiBase + "102";
					break;	
				case "g":
					returnascii = convertoasciiBase + "103";
					break;
				case "h":
					returnascii = convertoasciiBase + "104";
					break;
				case "i":
					returnascii = convertoasciiBase + "105";
					break;
				case "j":
					returnascii = convertoasciiBase + "106";
					break;
				case "k":
					returnascii = convertoasciiBase + "107";
					break;
				case "l":
					returnascii = convertoasciiBase + "108";
					break;
				case "m":
					returnascii = convertoasciiBase + "109";
					break;
				case "n":
					returnascii = convertoasciiBase + "110";
					break;
				case "o":
					returnascii = convertoasciiBase + "111";
					break;
				case "p":
					returnascii = convertoasciiBase + "112";
					break;
				case "q":
					returnascii = convertoasciiBase + "113";
					break;
				case "r":
					returnascii = convertoasciiBase + "114";
					break;
				case "s":
					returnascii = convertoasciiBase + "115";
					break;
				case "t":
					returnascii = convertoasciiBase + "116";
					break;
				case "u":
					returnascii = convertoasciiBase + "117";
					break;
				case "v":
					returnascii = convertoasciiBase + "118";
					break;
				case "w":
					returnascii = convertoasciiBase + "119";
					break;
				case "x":
					returnascii = convertoasciiBase + "120";
					break;	
				case "y":
					returnascii = convertoasciiBase + "121";
					break;
				case "z":
					returnascii = convertoasciiBase + "122";
					break;
// if user did not enter a letter between a-z show this					
				default:
					returnascii = "You have not entered a lowercase letter a-z.";
					break;					
			}
			
			return returnascii;
		
		/*
			The following will display your 
			results on the screen
		*/
		function ShowOnScreen(someText)
		{
			document.getElementById("DisplayResultsArea").innerHTML = someText;
		}

	</script>
</head>

<body>
	<!--
		This code creates a button that you can use to execute your JavaScript code.   
		You can copy and paste it to create as many buttons as you like.
		Just change the button text from "Do It" to something that describes your program.
		Then, change the function call to whatever function you with to call.
	-->
	<button onclick="convertlettertoascii()">Convert letter to Ascii</button><br>

	<!--
		This code creates a display area for results. It is popoulated by the function "ShowOnScreen", above.
	-->

	<p id="DisplayResultsArea" style="font-family:courier;color:blue;margin-left:20px;">You have selected letter:</p>

</body></html>