stefan s.
11/26/2003 6:26:00 PM
hi
thx for helping me!
"Bermejo, Rodrigo" <rodrigo.bermejo@ps.ge.com> schrieb im Newsbeitrag
news:3FC4CAE1.3030308@ps.ge.com...
> Try this...
>
>
> def random_text
>
> letters = ("a".."z").to_a
>
> letters.each_index do | l |
>
> r = rand(letters.length - 1);
>
> letters[l],letters[r] =letters[r],letters[l]
>
> end
>
> string = letters[0,rand(8)].to_s
>
> if string.empty?
> random_text
> else
> return string
> end
>
> end
>
> print %^<input type="text" name="zip" value=#{random_text}>^
>
>
>
> it is what you are looking for ?
>
>
>
>
>
> stefan s. wrote:
>
> >hi
> >
> >i´d like to fill out a html webform with ruby with randomly generated
> >values. an example:
> >
> >- the form is @ www.mypage.com/webform.html
> >- there´s one field in this form: "zip" (<input type="text" name="zip">)
> >- i should be filled out with a random text-value smaller than 8
characters
> >by the ruby script
> >
> >please help me!
> >
> >p.s. excuse my bad english :)
> >
> >
> >
> >
>
>
>