function rundum() { outtxt = ""; for( i = 0; i < document.InputForm.elements[0].value; i ++ ){ text = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; outtxt = outtxt + text.charAt( Math.round( Math.random( ) * ( 10 + 26 + 26 - 1 ) ) ); } document.InputForm.elements[1].value = outtxt; }