473,406 Members | 2,745 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,406 software developers and data experts.

javascript problem

4
The following code works in a textarea box Firefox but not IE8:

Expand|Select|Wrap|Line Numbers
  1. <script language="javascript">
  2. function repp()
  3. {
  4. var ss = document.getElementById('text').value;
  5. ss = ss.replace(/(\r\n)|(\n)/g,"<br />");
  6. document.getElementById('text').value = ss;
  7. }
  8. </script>
  9.  
  10.  
In IE, when you hit enter, there are no carriage returns and the text line does not break.

Thanks in advance for your help
Aug 17 '10 #1
4 1011
Oralloy
988 Expert 512MB
You might have to use Alt-Enter to make microsloth's software do your bidding.

Also, the pattern might want to be:
Expand|Select|Wrap|Line Numbers
  1. ss = ss.replace(/(\r\n)|(\n)|(\r)/g, "<br />"); 
Cheers!

Cheers!
Aug 17 '10 #2
cyuno
4
I made the change but IE still refuses to recognize hitting enter for carriage return in the textarea. Also hitting alt enter gives me a full screen view without the browser (I'm on windows xp)

Thanks for the quick response!

Regards,
cyuno
Aug 18 '10 #3
Oralloy
988 Expert 512MB
@cyuno,

There may be some options you can set on the textarea that allow it to capture carriage returns (CR) transparently.

I'm not sure why you're having problems. I use XP and I.E. 8 with few problems. I do know, from programming windows with C++, that text boxes can be set up to be CR sensitive or not. Perhaps that's your issue?
Aug 18 '10 #4
cyuno
4
Yes. I have a div which is separate from the textarea box which reflects what is being typed in the textarea box. In Firefox, the div exactly captures what is in the textarea box including CRs. This is not the case with IE.
Aug 18 '10 #5

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

Similar topics

4
by: Derek | last post by:
Hi, I've built a rather large CGI that dumps a lot of data and a fairly complex javascript app out to the client's browser. Granted this may be poor style according to someone web design...
3
by: Andy | last post by:
Hi, I am complete JavaScript novice and would really appreciate some help with this code: ===================================================================== <%@LANGUAGE="VBSCRIPT"...
6
by: David | last post by:
Hi, I have text link on each record displayed. This needs to open a new small window for entering some data, I cannot seem to fix it ? Hyperlink Code as is: ..... RS("Manual") &...
5
by: Mike | last post by:
In my previous post, I wrote: > ... > GOAL: (very simple) Provide a hyperlink which, when clicked, > calls a javascript function which opens a new URL. > ... > PROBLEM: The following code...
3
by: useenmelately | last post by:
Hello, I am working with asp.net 2.0 and have run into a problem with the custom validators. The client validation functions were originally written in vbscript, but as this is not compatible...
1
by: michael.bollhoefer | last post by:
I was running into issues with the images on the page not working under sub folders. If you leave a master file in the root folder and place content pages in the subfolder then when you hit a...
4
by: cedwa | last post by:
I am developing a site at http://www.nwlmi.org.uk The problem lies with the CSS/XHTML Menu which relies on JavaScript to open and close the sections. The parent sections open and close fine but...
2
by: Tatyana | last post by:
Hello, I was wondering if anybody know how to fix the problem with JavaScript in subfolders. I have the following in <body>
2
by: darren | last post by:
I have a small Javascript problem with that mutch love web browser safari, I tested the code on all other browsers PC (Win) and Linux and IE on the mac and it seams to work ok, but for some reason...
7
crystal2005
by: crystal2005 | last post by:
Hi all, I'm currenty creating a website. I got one confusing problem related to CSS and JavaScript actually, not really html. The problem is, I actually want my welcome screen page is to be random...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.