| kspn |
Apr 27 2009, 01:00 AM
Post
#1
|
|
Group: Members Posts: 3 Joined: 27-April 09 Member No.: 8,448 |
Hi,
I am trying to get the values form a Textarea, replace any returns with '. ' and also ensure that there are no duplicates (ie) '.. ' or '. . ' So far I am having weird results. CODE ProductOI = document.getElementById('ProductOI').value; ProductOI = ProductOI.replace(/\n/g, '\. '); ProductOI = ProductOI.replace(/\.\. /g, '\. '); ProductOI = ProductOI.replace(/\. \. /g, '\. '); The 'NewLine' code is working but the other two for some reason are not working as I am expecting them too. Each line of code run independently seems to work as expected, but when combined it fails. Any assistance would be appreciated. -------------------- No Coffee, No Workee
|
kspn Issues with Javascript Replace Apr 27 2009, 01:00 AM
kspn Solved!!
Windows was adding \r to it... Apr 27 2009, 01:55 AM
Christian J Multiple newlines like the following:
<textar... Apr 27 2009, 08:27 AM
Christian J
Also, IIRC Mac OS use only \r for newlines, ... Apr 27 2009, 01:12 PM
kspn
[quote name='Christian J' post='36686' date='Apr ... Apr 27 2009, 08:39 PM
Christian J I'm not good at regex, but I think this:
sho... Apr 28 2009, 05:02 AM![]() ![]() |
|
Lo-Fi Version | Time is now: 24th May 2013 - 08:38 PM |