Guest ovd Posted April 30, 2009 Share Posted April 30, 2009 what i must change in this code to generate a new line like this (new) tueuzl1 1c2uy3z 8l1mdad 76rmze0 y1yo15g h9kgvbh h9i6q6w (old) tueuzl1 1c2uy3z 8l1mdad 76rmze0 y1yo15g h9kgvbh h9i6q6w <P> <INPUT TYPE="button" VALUE="Click to generate letter sequences" ONCLICK="document.generator.output.value = ''; for(i=1;i<=document.generator.numSeq.value;i=i+1) { document.generator.output.value += generateRandSeq(document.generator.lenSeq.value, document.generator.letters.value) + ' '; };"> <P> <TEXTAREA NAME="output" ROWS=10 COLS=40 WRAP VALUE=""></TEXTAREA> I think that this is the part of the code that i must modify. Thanks Link to comment Share on other sites More sharing options...
0 Moustacha Posted April 30, 2009 Share Posted April 30, 2009 change generateRandSeq(document.generator.lenSeq.value, document.generator.letters.value) + ' '; to generateRandSeq(document.generator.lenSeq.value, document.generator.letters.value) + '\n'; \n is the escape character for a new line. \t for tab. They're the only ones I know off the top of my head. Link to comment Share on other sites More sharing options...
0 +Dick Montage Subscriber² Posted April 30, 2009 Subscriber² Share Posted April 30, 2009 Wow, could you not put that code into a function? Link to comment Share on other sites More sharing options...
0 Guest ovd Posted April 30, 2009 Share Posted April 30, 2009 Thanks a lot it's working :kiss: :) :D ;) :p Link to comment Share on other sites More sharing options...
Question
Guest ovd
what i must change in this code to generate a new line like this
(new)
tueuzl1
1c2uy3z
8l1mdad
76rmze0
y1yo15g
h9kgvbh
h9i6q6w
(old)
tueuzl1 1c2uy3z 8l1mdad 76rmze0 y1yo15g h9kgvbh h9i6q6w
<P> <INPUT TYPE="button" VALUE="Click to generate letter sequences" ONCLICK="document.generator.output.value = ''; for(i=1;i<=document.generator.numSeq.value;i=i+1) { document.generator.output.value += generateRandSeq(document.generator.lenSeq.value, document.generator.letters.value) + ' '; };"> <P> <TEXTAREA NAME="output" ROWS=10 COLS=40 WRAP VALUE=""></TEXTAREA>I think that this is the part of the code that i must modify.
Thanks
Link to comment
Share on other sites
3 answers to this question
Recommended Posts