CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 String Replace Quotation Marks

Print topic Send  topic

Author Message
ckroon

Posts: 869
Posted: 11/13/2008, 12:46 PM

Here is some code I have on an OnValidate Event.

I want it to remove any Returns/Line Breaks and also replace any double quote marks with single quote marks.
The Line break code works great.. but the next line of code shows up red in the code editor.. which I assume means it is problematic.
Any ideas?


$text2 = $comments_eta_feedback1->etafeedback_comment->GetValue();  
$text2 = str_replace(array("\n","\r"),array("",""),$comments_eta_feedback1->etafeedback_comment->GetText());  
$text2 = str_replace(" \" " ," \' ", $text2);  
$comments_eta_feedback1->etafeedback_comment->SetValue($text2);


_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
datadoit
Posted: 11/13/2008, 1:26 PM

Rather than checking for the escape sequence of the characters, check
for their ASCII representation instead.

chr(10), chr(13), etc. etc.
DonP
Posted: 11/13/2008, 1:43 PM

All versions of CCS that I've ever used have had this same problem.
Support has been promising a fix since the earliest versions but it has
not yet been made. Using the ASCII codes is only a workaround and not a
solution to an obvious and annoying bug.

In your example, it appears that it will look only for quotes that have
a space before and after them unless was done only here just for clarity.

Don (DonP)

ckroon wrote:
> Here is some code I have on an OnValidate Event.
>
> I want it to remove any Returns/Line Breaks and also replace any double quote
> marks with single quote marks.
> The Line break code works great.. but the next line of code shows up red in the
> code editor.. which I assume means it is problematic.
> Any ideas?
>
>
>
$text2 = $comments_eta_feedback1->etafeedback_comment->GetValue();  
> $text2 =  
> str_replace(array("\n","\r"),array("",""),$comments_eta_feedback1->etafeedback_comment->GetText());  
> $text2 = str_replace(" \" " ," \' "), $text2);  
> $comments_eta_feedback1->etafeedback_comment->SetValue($text2);
>
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.