|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
to control text wraping
Hi All,
I have a textarea on a page that accepts data froma user. Sometimes the users enter junk. Eg: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .... Add another 300 such chars. In our backend system, when we display the feedback that we get from the user, the page gets strecthed (almost a endless horizontal scroll bar.) I have set the TD width to about 300. The table width is set to 800. The textarea on the frontend looks like this "<textarea name="feedback" wrap="virtual" rows="3" class="answer" id="answerBox"></textarea>" Is their a way to force it to break or wrap around, instead of strecthing the page ? Any leads or suggestions will be useful. rig |
|
#2
|
|||
|
|||
|
I dont know of a way with html/css to constrain the display size of a continuous string of chars like that. You could use wrap="hard" in your textarea. Problem is, this literally inserts carriage returns into the data the user provided, which can lead to other problems.
Other than that, I suppose you could parse the input client side with JS before submitting, or server-side with CF, and if a single word is longer than is acceptable, then reject the input. Or just get rid of the malicious users if you have that level of access control. |
|
#3
|
|||
|
|||
|
Using javascript would do the trick and is the only way I've figured out this problem. You can limit the user to a maximum amount by not letting the cursor leave the form or preventing submission or something when the max has been exceeded.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > to control text wraping |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|