I've found this script
<script type="text/javascript">
$(document).ready(function() {
jQuery.fn.wordgen = function(length){
var i = 0;
var word = "";
var vowels = new Array("a","e","u","i","o");
var consonants = new Array("q","w","r","t","p","s","d","f","g","h","j","k","l","z","x","c","v","b","n","m");
while(i < (length/2)){
i++;
word += vowels[Math.floor(Math.random() * vowels.length)] + consonants[Math.floor(Math.random() * consonants.length)];
}
$(this).val(word);
}
$("#generarmu").click(function(){
var longitud = $("#largomu").val();
$("#nombremu").wordgen(longitud);
});
$("#largomu").change(function(){
var longitud = $("#largomu").val();
$("#nombremu").wordgen(longitud);
});
});
</script>
and i'm using it with
Longitud del nombre:
<select id="largomu" name="largomu">
<option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option> </select>
<br/>
<input id="nombremu" value="" style="padding-left:10px;height:25px;text-transform:uppercase;width:340px;"/>
<input type="input" id="generarmu" class="search_submit" style="width:200px;height:18px;" value="Generar!">
But i've got problems with even length of strings, the length of even string it's always +1 (odd)
You can check it here
THanks in advance