This should do the trick in JavaScript:

<script>

 function removeReturns(valueToRemoveFrom){
  mySeperator = String.fromCharCode(13) + String.fromCharCode(10);
  var tempArray = new Array();
  tempArray = valueToRemoveFrom.split(mySeperator);
  var newList = '';
  var listIndex = 0;
  for(listIndex=0;listIndex < tempArray.length;listIndex++){
   if(listIndex){
    newList = newList + ' ' + tempArray[listIndex];
   } else {
    newList = tempArray[listIndex];
   }
  }
  return newList;
 }

 function showNew(oldObj){
  oldObj.value = removeReturns(oldObj.value);
 }
</script>

<body>

<form name="myForm" action="javascript:void(0);">

<textarea name="myText1" cols="40" rows="5"></textarea>
<br><br>
<input type="Button" value="Show info with removed returns"
  onclick="javascript:showNew(document.myForm.myText1);">
</form>


I will include the FusionScript to do this client side for those of you
playing with the 1.0.2a version. Pretty straight forward, looks almost too
much like cold fusion code ~!  hehe

FusionScript Version:

<script>
    <cf_fusionscript action="libraries">
        form.*                 <!--- allows CF syntax form field
manipulation --->
        list.*                    <!--- allows access to CF list
functions --->
        string.*                <!--- allows access to CF string
functions --->
    </cf_fusionscript>
</script>

<cf_fusionscript action="code">
    <cf_fs_function name="removeReturns">
        form.myText1 = listChangeDelims(form.myText1, ' ', chr(13) +
chr(10));
    </cf_fs_function>
</cf_fusionscript>

<body>
<form>

<textarea name="myText1" cols="40" rows="5"></textarea>
<br><br>
<input type="Button" value="Show info with removed returns"
        onclick="<cf_fs_function call="removeReturns">">

</form>

Shameless plug - download FusionScript at www.fusionscript.com - its an open
source, freeware project to write client side code with server side syntax!

Nate Nielsen
[EMAIL PROTECTED]
817.726.8644


----- Original Message -----
From: "Schreck, Tom" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 26, 2002 9:39 AM
Subject: RE: carriage returns


I'd like to remove them please.

Thanks - Tom

-----Original Message-----
From: Nate Nielsen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 9:48 AM
To: [EMAIL PROTECTED]
Subject: Re: carriage returns


are you wanting to just check for them, or remove them or something?

(so I can write a script for ya)

Nate Nielsen
[EMAIL PROTECTED]
817.726.8644

----- Original Message -----
From: "Schreck, Tom" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 26, 2002 9:35 AM
Subject: carriage returns


Does anyone know how to check for carriage returns in a text box using
Javascript when doing form validation?

Thanks

Tom Schreck
[EMAIL PROTECTED]
817-252-4900

I have not failed.  I've found 10,000 ways that won't work.

- Thomas Edison


-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org



-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org



-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to