Allowing Percent in Search

Questions, tips and tricks and techniques for scripting in Servoy

Allowing Percent in Search

Postby rgerz » Sun Aug 22, 2010 5:57 am

I have a search that works perfectly, except that there are some values in a column that are used in the comparison that contain a percent sign "EO %". The search is actually matching "EO " against "EO " which isn't what I need. How do I keep the percent sign as part of the value?

Code: Select all
      forms.inst_tests.controller.find();
      forms.inst_tests.test_code = testcode;
      var recordcount = forms.inst_tests.controller.search();


Cheers,
Ray
rgerz
 
Posts: 15
Joined: Mon Jul 20, 2009 11:18 pm

Re: Allowing Percent in Search

Postby rgerz » Sun Aug 22, 2010 6:44 am

I solved issue with:

Code: Select all
testcode = utils.stringReplace(testcode,"%","\\%");


Cheers!
Ray
rgerz
 
Posts: 15
Joined: Mon Jul 20, 2009 11:18 pm


Return to Methods

Who is online

Users browsing this forum: No registered users and 14 guests