Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a two textfields in FormPanel. When one of them is empty, after pressing the search button the form sends the empty string in WFS query. How can I disable the empty field which sends the WFS request after I pressed the search button?

    formPanel = new GeoExt.form.FormPanel({
    ref: "formPanel",
    width: 300,
    height: 200,
    region: "west",
    protocol: protocol,
     text: "search",
     handler: function() {
     //scope: formPanel
    items: [{
        xtype: "textfield",
        name: "trans_id__eq",
        value: "",
        fieldLabel: "ID",
        disabled: true,
        ref: 'myTextField'

        xtype: "textfield",
        name: "nabywca__eq",
        value: "",
        fieldLabel: "nabywca",
        submitEmptyText: false 
    listeners: {
        actioncomplete: function(form, action) {
        // this listener triggers when the search request
        // is complete, the OpenLayers.Protocol.Response
        // resulting from the request is available
        // through "action.response"
            features = action.response.features;
  ;   //załadowanie zwróconego wyniku wyszukiwania do ""
                vecLayer = new OpenLayers.Layer.Vector("Results");



When I leave blank first textfield and put the value to the second my wfs request send empty string and I get the error.

My protocol:

var protocol= OpenLayers.Protocol.WFS({

            version: "1.1.0",
            url: "http://localhost:8080/geoserver/wfs",
            featureType: "transakcje_punkty",
            featureNS: "",
             srsName: "EPSG:900913"


Wfs is working properly when I have one field, but I would like to add 7 "textfields".

The user fills the fields with the attributes he want to find and rest leaves empty.

But empty field send some empty value to WFS and I get an error... instead results.

share|improve this question
add some code to your question, so people can help you to solve your problem. – Gery Jun 25 '13 at 13:13
and where is your protocol? – Gery Jun 25 '13 at 14:56

Try replacing

name: "trans_id__eq",


name: "transid__eq",

post also your protocol as part of your code, probably there is something wrong there.

Hope this helps,

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.