<script type="text/javascript">
window.onload = function(){
document.forms[0].onsubmit = function(){
var input = this.elements, i = input.length-1, array = [];
while(i--){
array.push(input[i].value);
}
alert(array.reverse().join());
};
};
</script>
<form action="" method="">
<input type="text" name="input" />
<input type="text" name="input" />
<input type="text" name="input" />
<input type="submit" name="input" />
</form>