ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old March 22nd, 2005, 08:02 AM
rigante rigante is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 56 rigante User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 16 m 45 sec
Reputation Power: 4
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

Reply With Quote
  #2  
Old March 22nd, 2005, 09:26 AM
fortunato fortunato is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 33 fortunato User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 36 m 52 sec
Reputation Power: 4
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.

Reply With Quote
  #3  
Old March 22nd, 2005, 02:38 PM
Bastion Bastion is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 181 Bastion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 4 h 23 m 47 sec
Reputation Power: 4
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > to control text wraping


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway