This is a discussion on "Textbox help pu-lease" within the JavaScript Forum section. This forum, and the thread "Textbox help pu-lease are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Textbox help pu-lease
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Textarea help pu-lease
Hi!
I've made some helping requests here in this forum, and I always get help from you guys. I'm counting on you this time too. Here's the problem I need help with. I have a textarea and I'm sending the data inside with a POST and get it on another page with .php as a string. I need javascript to check how many lines there are and put a certain string (for example: "<br />" at the end of every line. Is it possible to do this? We can maybe use another hidden form element to store the data "textarea with the <br>s"... So any help here would be much appreciated. THANK YOU! Last edited by hegerp; Jun 17th, 2008 at 12:18. |
|
|
|
||||
|
Re: Textbox help pu-lease
If you're using PHP, then nl2br (new line to break) should sort you out.
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
|
|||
|
Re: Textbox help pu-lease
Okay. I messed the first post up a little...
The main thing I want to do is to connect to a database and get the text data from there and then output the data with \n as a javascript alert box. I made a little sample code and it does not work! Can you please have a look at it for me?
Last edited by hegerp; Jun 18th, 2008 at 22:39. |
|
||||
|
Re: Textbox help pu-lease
Found the problem - posting solution shortly
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
|
||||
|
Re: Textbox help pu-lease
Ok, the problem lied in your foreach statement. If you look at the source code it generated, you'll see that the JavaScript code looked like this;
This new slice of code builds the alert statement first, combining the lines back together into a new, single-line string (with each piece now separated with a'\n' line feed)
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Last edited by Aso; Jun 19th, 2008 at 12:10. |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| textbox in datalist | ktsirig | ASP.NET Forum | 0 | Dec 14th, 2007 15:40 |
| TextBox problem | accessman | Databases | 1 | Oct 15th, 2005 01:19 |
| Error Message: TextBox | accessman | Databases | 1 | Oct 15th, 2005 01:07 |
| javascript textbox changer | Monie | JavaScript Forum | 8 | Aug 19th, 2004 06:46 |
| VS.NET, TextBox, overlay, DataGrid | Smokie | ASP.NET Forum | 10 | Jul 27th, 2004 12:17 |