Hi dgreenhouse,
Thank you so much for your response.
I'm not really sure what its called but here's an example with code:
If I input letter a then submit, then letter b and submit..., so I type: a , b, c, d, e
is it possible to get e, d, c, b, a
When I put your function which most likely 100% I'm using it wrong I get:
e, c, a, b, d
can you show me how to use your function I'm not really sure how the second function works.
Thank you again,
-sean.
- <html>
-
<head>
-
<script type="text/javascript" language="javascript">
-
var counter=0;
-
var alpha =new Array();
-
-
function reverseAlpha() {
-
var letterFromTxtBox;
-
letterFromTxtBox = document.forms[0][0].value;
-
alpha[counter]=letterFromTxtBox;
-
lastLetter=alpha[counter];
-
-
if ((alpha )){
-
counter++;
-
alert(" letters: " + alpha.reverse()+"\n"+ " Last letter typed: " + lastLetter ) ;
-
}
-
}
-
-
function reverseReverseArray(alpha) {
-
for (i=0; i<alpha.length; i++) {
-
alpha[i] = reverseString(alpha[i]);
-
}
-
alpha.reverse();
-
}
-
-
function reverseString(s_in) {
-
var s_out = "";
-
var i = s_in.length;
-
while (i>0) {
-
s_out += s_in.substring(i-1,i);
-
i--;
-
}
-
return s_out;
-
}
-
-
</script>
-
</head>
-
-
<body>
-
<form >
-
Letter: <input type="text" name="textBox" /><br />
-
<input type="button" value="Submit" onClick="reverseAlpha();" name="Submit" />
-
</form>
-
-
</body>
-
</html>