?
Solved

contentable div - double break

Posted on 2004-04-16
1
Medium Priority
?
1,174 Views
Last Modified: 2012-06-27
im having div with contenteditable=true attribute.
when users enter data and click "enter" to break line it does double break:

ex.

this is me

this is me

instead of

this is me
this is me

to avoid this i made this solution:
<div class="input" tabindex="2" id="edit" onfocus="Clean()" contentEditable="true">
                                                                  <div></div>
                                                                  Enter your message here
                                                            </div>

it was working OK until i decided to make default value for the content ("enter message here"),
and clean the text when the div get focus.
with this feture it makes double break again

any solutions?
0
Comment
Question by:eladr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 7

Accepted Solution

by:
searlas earned 300 total points
ID: 10840357
The 'double break' you refer to is a new paragraph.  i.e. hitting enter inserts <p>...</p>.  You can use CSS to change the margin/space above and below a <p> tag if you wish:
<style type="text/css">
P { margin-top: 0px; margin-bottom: 0px }
</style>
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question