CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 trim(); where do I use it in CCS search grid???

Print topic Send  topic

Author Message
jim7567g

Posts: 38
Posted: 01/09/2005, 6:25 PM

I have a problem with the search grids and being a newbie to this stuff I have been unable to figure this apparently simple problem out.

When a user enters search criteria into a text box and adds an extra space at the end his search results are null. I believe all I need to do is use the trim() function to take care of this but I am unable to figure out how to add this into the code.

Can I add the trim() function via the properties window? If so where?

If I have to add it to the code page what section of a search box would I add it to?
Initialize
Validate
Check Errors
Operation
Show
?????

Thanks for any help I can get.
Jim

_________________
Jim
View profile  Send private message
jim7567g

Posts: 38
Posted: 01/16/2005, 12:19 PM

Found it. Maybe this will help other newbies.

Open Common.php and find this section:
//CCCollectionToString @0-883F2B49  
function CCCollectionToString($ParametersCollection, $RemoveParameters)  
{  
  $Result = "";   
  if(is_array($ParametersCollection))  
  {  
    reset($ParametersCollection);  
    foreach($ParametersCollection as $ItemName => $ItemValues)  
    {  
      $Remove = false;  
      if(is_array($RemoveParameters))  
      {  
        for($I = 0; $I < sizeof($RemoveParameters); $I++)  
        {  
          if($RemoveParameters[$I] == $ItemName)  
          {  
            $Remove = true;  
            break;  
          }  
        }  
      }  
      if(!$Remove)  
      {  
        if(is_array($ItemValues))  
          for($J = 0; $J < sizeof($ItemValues); $J++)  
            $Result .= "&" . $ItemName . "[]=" . urlencode(CCStrip(trim($ItemValues[$J])));  
        else  
           $Result .= "&" . $ItemName . "=" . urlencode(CCStrip(trim($ItemValues)));  
      }  
    }  
  }  
  
  if(strlen($Result) > 0)  
    $Result = substr($Result, 1);  
  return $Result;  
}  
//End CCCollectionToString


I put the added trim statement area in bold.

_________________
Jim
View profile  Send private message

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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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