Hi, 

This is my function:
<pre>&lt;html&gt;
  &lt;head&gt;
  &lt;META HTTP-EQUIV=&quot;Content-Type&quot; CONTENT=&quot;text/html; charset=iso-8859-15&quot;&gt;
    &lt;title&gt;OpenLayers: Google Layer Example&lt;/title&gt;
    &lt;link rel=&quot;stylesheet&quot; href=&quot;http://openlayers.org/api/theme/default/style.css&quot; type=&quot;text/css&quot; /&gt;
    &lt;link rel=&quot;stylesheet&quot; href=&quot;http://openlayers.org/dev/examples/style.css&quot; type=&quot;text/css&quot; /&gt;
    &lt;!-- this gmaps key generated for http://geoserver.e.florasul.pt:8080/geoserver/ --&gt;
    &lt;script src=&quot;http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=ABQIAAAA9g9Gyhn_sxqfjeV5VmcEgBSQW2MnFpcs8J7iF2tReTA-lhmzIRSSMs_ZN_i7TfRlNhvx1kGWWYvHzw&amp;amp;language=pt-PT&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;http://openlayers.org/api/OpenLayers.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
    
      var map;

      function init() {
        // Create the map object
        map = new OpenLayers.Map('map');
                
        // Create a Google layer
        var gmap = new OpenLayers.Layer.Google(
            &quot;Google Streets&quot;, // the default
            {numZoomLevels: 100}
        );
                // create Google Satellite layer
  var gsat = new OpenLayers.Layer.Google(
      &quot;Google Satellite&quot;, //
      {type: G_SATELLITE_MAP,}
  );
        // Add layer to map
                map.addLayers([gmap,gsat]);
                map.addControl(new OpenLayers.Control.LayerSwitcher());
                
        // Zoom to Portugal
        map.setCenter(new OpenLayers.LonLat(-8, 39.6), 6.85);  
                
                
      }
          
function drc_filter(drc_value){
if (drc_value == '') {alert ('DRC'); return false;}
else {
var drc_value_stage1 = drc_value;
var drc_value_stage2 = drc_value_stage1.replace(&quot;/&quot;,&quot;'&quot;);
var drc_value_stage3 = drc_value_stage2.replace(&quot;/&quot;,&quot;'&quot;);
//Initialize WMS layer from our local GeoServer

var bwms = new OpenLayers.Layer.WMS( &quot;CAOP&quot;,
&quot;http://xxx:8080/geoserver/wms&quot;,

CQL_FILTER:drc_value_stage2,
&quot;transparent&quot;:&quot;true&quot;,
&quot;layers&quot;:&quot;s:c_wgs&quot;,
&quot;format&quot;:&quot;image/png&quot;},
{&quot;reproject&quot;:&quot;true&quot;}
);
map.addLayer(bwms);
var re = new OpenLayers.Layer.WMS( &quot;Red&quot;,
&quot;http://xxx:8080/geoserver/wms&quot;,

CQL_FILTER:drc_value_stage2,
&quot;transparent&quot;:&quot;true&quot;,
&quot;layers&quot;:&quot;s:r&quot;,
&quot;format&quot;:&quot;image/png&quot; },
{ &quot;reproject&quot;:&quot;true&quot; }
);
map.addLayer(re);
var se = new OpenLayers.Layer.WMS( &quot;Sub&quot;,
&quot;http://xxx:8080/geoserver/wms&quot;,

CQL_FILTER:drc_value_stage2,
&quot;transparent&quot;:&quot;true&quot;,
&quot;layers&quot;:&quot;s:y&quot;,
&quot;format&quot;:&quot;image/png&quot; },
{ &quot;reproject&quot;:&quot;true&quot; }
);

// Add WMS layer to our map
map.addLayer(se);
}

}


    &lt;/script&gt;
  &lt;/head&gt;

  &lt;body onload=&quot;init()&quot;&gt;
  &lt;?php
  

$query = &quot;SELECT * FROM c_wgs order BY conc limit 5&quot;; 

$result = pg_query($query); 
if (!$result) { 
            echo &quot;Problem with query&quot;; 
            echo pg_last_error(); 
            exit(); 
        } 
  ?&gt;
    &lt;h1 id=&quot;title&quot;&gt;OpenLayers: WEBSIG&lt;/h1&gt;
   &lt;div style=&quot;width:40%; height:80%&quot; id=&quot;map&quot;&gt;&lt;/div&gt;
   &lt;select id=&quot;drc&quot; onchange=&quot;drcv(this.options[this.selectedIndex].value);&quot;&gt;
   &lt;option value=&quot;&quot;&gt;&gt;&gt; FILTRAR POR DRC &lt;&lt;&lt;/option&gt;
&lt;?php
        while($row = pg_fetch_assoc($result)) { 
                
?&gt;

&lt;option value='&lt;?php echo 'dio1=/'.$row['dio1'].'/'?&gt;'&gt;&lt;?php echo $row['dio1'] ?&gt;&lt;/option&gt;

&lt;?php
        } 
        ?&gt; 
&lt;/select&gt;   

  &lt;/body&gt;

&lt;/html&gt;</pre>

I want that every time that I change the values of my select box, uptade the filter and not create a new one.

Eg:
I have 3 layer or orverlayer but every time that I change the value in select box a new layer or overlayer are created.
<img src="http://osgeo-org.1803224.n2.nabble.com/file/n6929587/layer.jpg" border="0"/>

And I just want update this 3 layers 

How can I dos this ?

Andre Bolinhas
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/Update-wms-filter-tp6929587p6929587.html">Update wms filter</a><br/>
Sent from the <a href="http://osgeo-org.1803224.n2.nabble.com/OpenLayers-Users-f1822463.html">OpenLayers Users mailing list archive</a> at Nabble.com.<br/>