Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Carriage Return

Status
Not open for further replies.

saw15

Technical User
Jan 24, 2001
468
US
I am using a javascript function to return an address. But when pulling the address back, I am getting a carriage return added to the line, which is causing the function to error out. I need to remove the carriage return, here is small part of function. It is with the address1 and city only that the carriage return is getting added.

function ChangeStatus(status){
var address1 = &quot;<%=Trim(l_objQuoteSummary.Address1)%>&quot;;
var city = &quot;<%=Trim(l_objQuoteSummary.City)%>&quot;;
var state = &quot;<%=Trim(l_objQuoteSummary.State)%>&quot;;
var flg;

Help is appreicated.
 
> var address1 = &quot;<%=Trim(l_objQuoteSummary.Address1)%>&quot;;

Problem is that l_objQuoteSummary.Address1 probably has the carriage return but you can apply the solution to any of the three. I use replace to strip out unwanted characters:

var address1 = &quot;<%=Trim(Replace(l_objQuoteSummary.Address1,vbcrlf,&quot;&quot;))%>&quot;;

Sometimes though it is either a LineFeed or a Carriage Return but not both, so on rare occation you may need:
Replace(l_objQuoteSummary.Address1,Chr([HexFor LF OR CR],&quot;&quot;)

Hope that helps...
 
or u can replace it in javascript itself...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top