Jump to content

textarea input


Guest upirate

Recommended Posts

Guest upirate

I am currently using

 

//lets make sure that details allows alpha numeric, space, $, (), -, period, and []

$text = preg_replace("/[^a-zA-Z0-9\-\s\$\.\(\)\]\[]/i", "", $input);

 

however what do i need to do to be able to cut and paste into the text area and maintain the paragraph and new lines ?

 

 

 

thanks guys ???

 

 

Link to comment
https://forums.phpfreaks.com/topic/46680-textarea-input/
Share on other sites

You can preload a textarea with text using PHP, but only when you first send the page to the user.  Once the user has the page, obviously you'll only be able to manipulate form data with JavaScript, or some other client-side language.

 

If you wish to retain line breaks, include "\n" in your character class.  Then put the text between the <textarea> (insert text here) </textarea> tags.

Link to comment
https://forums.phpfreaks.com/topic/46680-textarea-input/#findComment-227638
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.