Following code seems to do the trick incase anyone else is following.
<input type="text" name="nameOne" id="nameOne" size="20" pattern = "[A-Z][a-z]+( [A-Z][a-z]+)?" title="Please enter a name (Surname optional) with First Letter capitalised" onblur="isFilled(this)">
var temp = [this.nameOne.value, this.mark1.value, this.mark2.value, this.mark3.value, this.mark4.value ];
var stringData = temp.join( "\n" );
Thanks for the help. This forum will come in real handy for learning code.