[Flashcoders] disabling carriage returns in multiline input text fields

2007-03-21 Thread john hoffsis
Does anyone know if it's possible to restrict hard returns in text input fields 
(fields must wrap)? 

  I have form fields to capture user input that I'm sending up to the  server 
to be stored in a database. When I request this stored data from  the server, 
anything after a hard return is lost.

I've tried something like this:
  my_txt.restrict="^\u0013", and a bunch of variations thereof, but  nothing 
seems to keep the Enter key from doing it's thing. 
  
  Second best would be to traverse through a string a user has entered  and 
replace hard returns with a space or dash, but again I've had no  luck looking 
for \n or \r. I've tried entering text and hard returns  into a dynamic 
textfield set to input, but when I try this:
  var n:Number = my_txt.indexOf("\n")...
  trace("n: "+n) //traces "n: -1"

  Anyone have any insight into this?

Thanks,
John
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] disabling carriage returns in wrapping text fields

2007-03-21 Thread john hoffsis
Does anyone know if it's possible to restrict hard returns in text input fields 
(fields must wrap)? 
  
  I have form fields to capture user input that I'm sending up to the  server 
to be stored in a database. When I request this stored data from  the server, 
anything after a hard return is lost.
  
  I've tried something like this:
my_txt.restrict="^\u0013", and a bunch of variations thereof, but nothing 
seems to keep the Enter key from doing it's thing. 

Second best would be to traverse through a string a user has entered  and 
replace hard returns with a space or dash, but again I've had no  luck looking 
for \n or \r. I've tried entering text and hard returns  into a dynamic 
textfield set to input, but when I try this:
var n:Number = my_txt.indexOf("\n")...
trace("n: "+n) //traces "n: -1"
  
Anyone have any insight into this?
  
  Thanks,
  John
  
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com