473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to get line break and carriage return in text box to work on IE?

4
I am having problems in IE with the following text box javascript code. In Firefox the line breaks and carriage returns work perfectly but not in IE:

Here is the javascript:
Expand|Select|Wrap|Line Numbers
  1.     function repp(){
  2.                 var ss = document.getElementById('description').value;
  3.                 ss = ss.replace(/(\r\n)|(\n)/g,"<br/>");
  4.                 document.getElementbyId('description').value = ss;
  5.             }
  6.  
Here is the text box code:
Expand|Select|Wrap|Line Numbers
  1.  
  2. <div id="description" name="text" style="font-family:Arial,Helvetica,sans-serif;font-size:18px;position:relative;top:100px;left:400px;color:navy;font-weight:bold;width:300px;height:300px;white-space:pre-wrap;word-wrap:break-word;_white-space:pre;" >
  3.  
  4.  
  5.  
  6.  
  7.                                    </div>
  8.  
  9. <td  width="400px" valign="top" onkeypress="repp();"><textarea id="message" name="message"  style="width:300px;height:100px;" onblur="javascript:process_input();" onkeypress="return ismaxlength(this)" class="content" onkeyup="checkTaLength(this, 'charcount01', 'remaining01', 1000);" onkeydown="checkTaLength(this, 'charcount01', 'remaining01', 1000);" onmouseout="checkTaLength(this, 'charcount01', 'remaining01', 1000);" onfocus="checkTaLength(this, 'charcount01', 'remaining01', 1000);" ></textarea><br/><span style="font-size:11px; color:#CC0000"><span id="charcount01">0</span> characters entered.   |   <span id="remaining01">1000</span> (of 1000) characters remaining.</span></td>
  10.  
Nov 11 '10 #1
0 1276

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Owen Parker | last post by:
Hi all I am not a java programmer but i can hack at it a bit. I am trying to allow a user to define the text in a simple javascript text scroller. The data is stored as multiple records in a...
2
by: Charles Mendell | last post by:
1. When I go to http://www.w3schools.com/js/default.asp and choose: 2. JS HTML DOM and then choose: 3. the Window object and then choose: 4. Write some text in the windows status bar ( a link)...
6
by: Krakatioison | last post by:
Someone posted a text problem, but wasn't specified correctly. Problem: Need to extract al sentences from the text file where there is more than 3 continuouse sentences with more than 5...
4
by: Henry | last post by:
Hi I have a problem, pls see below: <html> : <script type="text/javascript"> <!-- function addCode () { document.getElementById('emptySpace').innerHTML+=
7
by: John | last post by:
Hi Everyone, I'm having this extremely annoying problem with Internet Explorer 6, giving me an error message saying "unknown runtime error" whenever I try to alter the contents of a <divelement...
1
by: JohnnieTech | last post by:
I am using some javascript/ajax to load content into a main div. The problem I am running into is that it will work in IE but not in FF. In FF I don't get any sort of load at all. I have a 1...
2
by: silpa | last post by:
Hi, I have placed two text boxes(server side) for Name and Age in asp.net 2.0. Their ids are txtPatientName and txtPatientAge. The validation to be done is both text boxes should not be...
31
by: ajos | last post by:
hi frnds, i have a form,which has 2 input text boxes, the values are entering the text boxes,when i leave the 2 text boxes blank and hit submit a java script gives the message that the 2 fields are...
6
by: James007 | last post by:
Hi everyone, I am developing a web page for an embedded application. I created a text box for entering a value (only 1 byte long). The onchange event triggers correctly when I enter the value...
1
by: paulyXvpf | last post by:
Hello javascript folks, PROBLEM: Javascript dropdown problem in IE 6 and IE7 DESCRIPTION: menu falls behind a container box on web page COMMENTS: It works fine in Firefox but not in IE 6/7...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.