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. |
 |
 |
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/
>
|
|
|
 |
|