OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Carriage returns in javascript variable

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Carriage returns in javascript variable
Page: [1]
 
kt

 

Posts: 199
Joined: 11/3/2004
Status: offline

 
Carriage returns in javascript variable - 10/11/2009 14:30:15   
Hi

I'm using an ajax script to post form input to a database. My problem is how to get the script to recognise the carriage returns in input from a text area.

Here's the part of the script which defines the variable:

	  var details = $("textarea#details").val();


This then becomes part of a datastring which is passed to a page where the values are inserted into the database:

	var dataString = 'title=' + title + '&details=' + details;
		//alert (dataString);return false;
		
		$.ajax({
      type: "POST",
      url: "/includes/forms/process_post.asp",
      data: dataString,
.....


If the user separates input in the textarea into paragraphs, how can I pick this up in the above script so that the carriage returns are inserted into the database?

Many thanks for your help.

kt
Tailslide

 

Posts: 6692
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Carriage returns in javascript variable - 10/12/2009 1:27:48   
I tend to use TinyMCE as a little wysiwyg editor for textareas in client CMSs etc - when the user types anything into it, html is added (Ps and BRs etc) and that is saved to the db along with the text itself. Makes it much easier to reproduce that information correctly when you drag it out of the DB later on.

FCKeditor is another, similar option.

_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to kt)
Livinson

 

Posts: 1
Joined: 10/12/2009
Status: offline

 
RE: Carriage returns in javascript variable - 10/12/2009 8:02:40   
click here to know more:)

(in reply to Tailslide)
Tailslide

 

Posts: 6692
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Carriage returns in javascript variable - 10/12/2009 8:16:14   

quote:

ORIGINAL: Livinson

click here to know more:)


Goodness Livinson - that "Google" site you've found is great!!! I'm sure it'll be really popular once it makes a name for itself - thanks again!

_____________________________

Little Blue Plane Web Design | Land Rover project

:)

(in reply to Livinson)
TexasWebDevelopers

 

Posts: 722
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Carriage returns in javascript variable - 10/12/2009 10:12:08   
Tiny MCE demo
http://www.texaswebdevelopers.com/examples/content-editor-demo.asp

_____________________________

:)

Follow us on TWITTER

(in reply to Tailslide)
kt

 

Posts: 199
Joined: 11/3/2004
Status: offline

 
RE: Carriage returns in javascript variable - 10/12/2009 18:01:33   
Many thanks, I'll give TinyMCE a try.

kt

(in reply to kt)
Page:   [1]

All Forums >> Web Development >> General Web Development >> Carriage returns in javascript variable
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts