P
paul.denlinger
Please excuse this very basic question; I'm just starting to learn
JavaScript.
I have just modified added a toUpperCase statement to change strings
to upper case, but it does not run.
Can you please tell me what I have done wrong? I have pasted the code
in below.
Thank you.
-------------------------------------------------------------------------------------------------
// JavaScript Document
// initialize the counter and the array
var numnames=0;
var names = new Array();
function SortNames() {
// Get the name from the text field
SortNames toUpperCase();
//Change the names to all upper case
thename=document.theform.newname.value;
// Add the name to the array
names[numnames]=thename;
// Increment the counter
numnames++;
// Sort the array
names.sort();
document.theform.sorted.value=names.join("\n");
JavaScript.
I have just modified added a toUpperCase statement to change strings
to upper case, but it does not run.
Can you please tell me what I have done wrong? I have pasted the code
in below.
Thank you.
-------------------------------------------------------------------------------------------------
// JavaScript Document
// initialize the counter and the array
var numnames=0;
var names = new Array();
function SortNames() {
// Get the name from the text field
SortNames toUpperCase();
//Change the names to all upper case
thename=document.theform.newname.value;
// Add the name to the array
names[numnames]=thename;
// Increment the counter
numnames++;
// Sort the array
names.sort();
document.theform.sorted.value=names.join("\n");