Tony Gray wrote: > We have 2 Questions, both involving the search tool settings within > js_custom.php: > > *1.)* Can you perform 2 different searches on 2 separate fields within a > single layer? When I enter the following code into the search list > within the js_custom.php file:
> searchList['anomaly_flag'] = new Array('<?php echo _("Anomaly by > Utility") ?>', '#UTIL_ID', '<?php echo _("Utility ID") ?>',''); > > searchList['anomaly_flag'] = new Array('<?php echo _("Anomaly by Event") > ?>', '#EVENT_ID', '<?php echo _("Event ID") ?>',''); > > ?only the second search is available. Do I have to create two separate > layers to perform a search such as this? > unfortunately the logic of this search uses the layer name as key for the object. So the second definition overwrites the first. I haven't thought of this. One could of course put the layer name inside the array and modify the Javascript that creates the search form. And with pmapper 1 you could again use the old (and a bit more complicated) definition of search, replacing the new files with old ones. I am still planning to offer an alternate definition for more complex searches, especially - but not only - for PostGIS layers. Probably with definitions of all parameters via XML. But this may take some time, I have to admit... > > *2.)* In past versions of p.mapper (we are using 1.2.0 currently) we > have performed one search with multiple criteria within a layer. For > instance a house number and a street. The code looked like this within > the search.phtml file: > > case "addresses": > echo("<td>". _("House Number") ." </td> \n"); > echo("<td><INPUT TYPE=text NAME=\"HOUSE\" SIZE=15></td> \n"); > echo("<td>". _("Street") ." </td> \n"); > echo("<td><INPUT TYPE=text NAME=\"#STREET\" SIZE=15></td> > \n"); > echo("<td><INPUT TYPE=hidden NAME=\"qlayer\" > VALUE=\"addresses\"></td> \n"); > break; > > How do we perform this type of search in the newer versions of p.mapper, > now that the search code is within the js_custom.php file? > > This is described in the comments in the file js_custom.php: "* you can specify more than one field for search by separating the search fields with a double ampersand &&" And there is a commented example: searchList['images'] = new Array('<?php echo _p("Images")?>', '#sat_id&&acq_year', '<?php echo _p("Satellite") ?>&&<?php echo _p("Acqusition Year") ?>',''); I use it, so it should work. Armin