<html lang="en">
<script language="javascript" type="text/javascript">
function randomString() {

var chars ="";

var string_length = 4;

var randomstring = '';

for (var i=0; i<string_length; i++)
{
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}

document.randform.randomfield.value = randomstring;
}
</script>

<form name="randform">
<input type="button" value="click to text shuffle" onClick="randomString();">&nbsp;
<input type="text" name="randomfield" value="">

</form>
</html>


sample.jpgsample.jpg