![]() | ![]() | ![]() |
| |||||||
| Forums | Register | Groups | Awards | Arcade | Pets | T-Bucks / T-Store | Invite Your Friends | Blogs | Mark Forums Read |
| Web Design Forums and discussions on webdesign |
Web Design | |||||||||
|
|
|
|
| |||||
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Civilians | I mean let's face it, using just text you can, but it's an ugly one line field. And in textarea, it's all pretty, but there doesn't seem to be way to limit the length. What gives? And how could someone not design an inbetween? Thanks |
|
| | #2 (permalink) |
| Civilians | "Serg" wrote ... >I mean let's face it, using just text you can, but it's an ugly one > line field. > > And in textarea, it's all pretty, but there doesn't seem to be way to > limit the length. > > What gives? And how could someone not design an inbetween? For that Serg you would be requiring a little client side script - add a javascript function that counts the characters that have been entered, triggered by a text change or a keypress - when it getes to the magical figure, prevent the user from entering anymore text and maybe display an alert box to the screen to advise them... Something like this could be good: Put this in the HEAD tags of your page... <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function textCounter(field, countfield, maxlimit) { if (field.value.length > maxlimit) // if too long...trim it! field.value = field.value.substring(0, maxlimit); alert("parp!"); } // End --> </script> Put within your FORM tags.. <textarea name="message" onKeyDown="textCounter(this.form.message,125);" onKeyUp="textCounter(this.form.message,125);"></textarea> Give it a go - hope it helps.. Rob |
|
![]() |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Syntax highlighting in a textarea | Dylan Parry | Web Design | 2 | 10-27-2005 14:03 |
| textarea rows | Sig | Web Design | 6 | 10-23-2005 18:02 |
| Weird Web Form problem - empty forms and blank from field | Rocky | Web Design | 5 | 06-16-2005 08:00 |
| Text Area form field/tab delimited text problems | Brian | Web Design | 0 | 07-23-2004 15:09 |
| Form field should start with certain characters | Van Duijn | Web Design | 1 | 06-15-2004 18:32 |
![]() | ![]() | ![]() |