|
|
Textarea max rows and max characters per row
I have read a number of posts with techniques for limiting the max
number of characters entered into a textarea, but I'm looking for some
advice on how to limit the number of rows and the number of characters
per row.
Basically, I need to allow users to enter up to 5 rows of data with up
to 40 characters per row, regardless of whether or not the user has
explicitly entered any line breaks. I also need to consider where to
break off each line without breaking in the middle of a word.
Any advice would be greatly appreciated.
|
|
0
|
|
|
|
Reply
|
gregory
|
1/16/2004 9:33:19 AM |
|
Hello,
Basically, row1 and row2 are seperated by a new line character ("\n").
Word wrapping visually shows multiple rows however it is still the same row.
So to limit number of rows, simply count how much new line characters there
are.
To limit characters per row, simply scan each row and check its length.
<script>
t = "hello\n" +
"world\n";
lines = t.split('\n');
</script>
This script will create an array which holds every line...
--
Elias
"Greg Ferris" <gregory@ferris.net> wrote in message
news:8879826f.0401160133.25d7508e@posting.google.com...
> I have read a number of posts with techniques for limiting the max
> number of characters entered into a textarea, but I'm looking for some
> advice on how to limit the number of rows and the number of characters
> per row.
>
> Basically, I need to allow users to enter up to 5 rows of data with up
> to 40 characters per row, regardless of whether or not the user has
> explicitly entered any line breaks. I also need to consider where to
> break off each line without breaking in the middle of a word.
>
> Any advice would be greatly appreciated.
|
|
0
|
|
|
|
Reply
|
lallous
|
1/16/2004 9:58:16 AM
|
|
Elias,
Thank you for the help. The issue isn't what happens when a user
enters a line break - I can detect that pretty easily. The issue is
how I treat an entry WITHOUT line breaks. In other words, if the user
types continuously, I need to then programatically create line breaks
for the user (instead of just wrapping), still following the rules
that there can only be five rows and 50 characters per row. Further,
when creating these breaks, I want to be sure that I'm not doing it in
the middle of a word.
Thanks,
Greg
"lallous" <lallous@lgwm.org> wrote in message news:<bu8cvj$ej3o0$1@ID-161723.news.uni-berlin.de>...
> Hello,
>
> Basically, row1 and row2 are seperated by a new line character ("\n").
> Word wrapping visually shows multiple rows however it is still the same row.
>
> So to limit number of rows, simply count how much new line characters there
> are.
>
> To limit characters per row, simply scan each row and check its length.
>
> <script>
> t = "hello\n" +
> "world\n";
>
> lines = t.split('\n');
> </script>
>
> This script will create an array which holds every line...
> --
> Elias
> "Greg Ferris" <gregory@ferris.net> wrote in message
> news:8879826f.0401160133.25d7508e@posting.google.com...
> > I have read a number of posts with techniques for limiting the max
> > number of characters entered into a textarea, but I'm looking for some
> > advice on how to limit the number of rows and the number of characters
> > per row.
> >
> > Basically, I need to allow users to enter up to 5 rows of data with up
> > to 40 characters per row, regardless of whether or not the user has
> > explicitly entered any line breaks. I also need to consider where to
> > break off each line without breaking in the middle of a word.
> >
> > Any advice would be greatly appreciated.
|
|
0
|
|
|
|
Reply
|
gregory
|
1/16/2004 7:21:30 PM
|
|
|
2 Replies
603 Views
(page loaded in 0.797 seconds)
Similiar Articles: Textarea max rows and max characters per row - comp.lang ...I have read a number of posts with techniques for limiting the max number of characters entered into a textarea, but I'm looking for some advice on ho... matrix / arrays with row, column labels + alignment? - comp.text ...Textarea max rows and max characters per row - comp.lang ... matrix / arrays with row, column labels + alignment? - comp.text ..... label data is text in c character ... Character count and character check in JTextField - comp.lang.java ...Textarea max rows and max characters per row - comp.lang ... Character count and character check in JTextField - comp.lang.java ... Textarea max rows and max ... Limiting the number of characters in a JTable cell. - comp.lang ...Textarea max rows and max characters per row - comp.lang ..... read a number of posts with techniques for limiting the max number of characters ... Limiting number of characters in a JTable columns? - comp.lang ...Textarea max rows and max characters per row - comp.lang ..... posts with techniques for limiting the max number of characters ... Limiting the number of characters in a ... LotRO: How many characters can you have? - comp.sys.ibm.pc.games ...Character count and character check in JTextField - comp.lang.java ... Textarea max rows and max characters per row - comp.lang ..... simply count how much new line ... find max in 3D array -- slow - comp.lang.idl-pvwaveTextarea max rows and max characters per row - comp.lang ... find max in 3D array -- slow - comp.lang.idl-pvwave I need to find the maxium at each ... 100,2900)) Then ... Size of "Hello world" - comp.lang.c++Textarea max rows and max characters per row - comp.lang ... To limit characters per row, simply scan each row and check its length. <script> t = "hello\n" + "world\n ... A sort order column? - comp.databases.mysqlEach row is supposed to have a particular ... So, I could use the MAX(sort_order ... So if someone wants to shift row A between rows B and C, just check the gap length (per ... concatenation with a for loop - comp.lang.verilog... header[(max-idx ... clean with 4 rows of 4 elements each ... to single row - comp.soft-sys.matlab ..... your situation correctly, each time through your loop the character ... Textarea max rows and max characters per row - comp.lang ...I have read a number of posts with techniques for limiting the max number of characters entered into a textarea, but I'm looking for some advice on ho... Textarea max rows and max characters per row - HighDots ForumsI have read a number of posts with techniques for limiting the max number of characters entered into a textarea, but I'm looking for some advice on 7/20/2012 12:50:11 PM
|
|
|
|
|
|
|
|
|