* yesss I got the idea. it seems great! also i will follow your advice "display the layer with WMS" after the search function completed.
but now when i enter the text to search (id), all features are displayed again. not just what i searched for. am not sure what's wrong * var vessels = new OpenLayers.Layer.Vector("The Vessels", { displayOutsideMaxExtent: true, styleMap: new OpenLayers.StyleMap(style), maxExtent: new OpenLayers.Bounds(-180, -90, 180,90)transform(geographic,mercator), sphericalMercator: true, strategies: [strategy], //BBOX strategy protocol: wfsprotocol }); *and the other parts are exactly as you wrote* vessels.destroyFeatures(); vessels.addFeatures(request.features); map.zoomToExtent(sExt); <input type="submit" value="Search" /> <input type="text" name="Search" id="searchText" value="Enter the id " style="text-align:right" maxlength="100" /> -- View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-apply-a-Search-Function-tp4364140p4459172.html Sent from the OpenLayers Users mailing list archive at Nabble.com. _______________________________________________ Users mailing list us...@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-users