title: 'Ext Js' form field validation using 'validator'
body: <p>Hi I'm very new to 'Ext JS' (about 4 days) and have to edit 'Ext JS' form. That form is to edit existing entry. So I have to update 'project name' field in this form and need to follow following conditions.</p>
  <ol>
  <li><p>Users can submit form with its old project name (old old project
  name means project name when form is load).</p>
  </li>
  <li><p>When user select existing project name from suggestion drop down (except old project name), need to show error.</p>
  <p>Basic idea of this conditions is prevent duplicate project names.</p>
  </li>
  </ol>
  <p>So I try to do this with 'validator' but I can't find a way to compare old project name and new project name.</p>
  <ol>
  <li>Is there any method to compare those values ??</li>
  <li>Any other way to validate this field ???</li>
  </ol>
  <p>this is what I have done so far...</p>
  <pre><code>_est.project.view.panel.updateprojectname.combox = function (projectdetails) {
  var nstore = _est.project.view.panel.updateprojectnstore();
  var combo = Ext.create('Ext.form.ComboBox', {
      fieldLabel: _est.project.text.nameText,
      store: nstore,
      labelSeparator: ' ',
      vtype: 'text',
      afterLabelTextTpl: _est.afterLabelTextRequiredTpl,
      msgTarget: 'side',
      displayField: 'projectname',
      valueField: 'projectname',
      labelWidth: 130,
      maxLength: 200
      name: 'projectname',
      allowBlank: false,
      pageSize: true,
      triggerAction: 'query',
      autoSelect: true,
      minChars: 0,
      itemId : 'project-name-field',
      value: Ext.htmlDecode(projectdetails.projectname),
      hideTrigger: true,
      anchor: '95%',
      validator: function(oldValue) {  
          var existnstore = Ext.StoreMgr.lookup(&quot;ptoject-project-names-get-store&quot;);
          if(existnstore){
              var nstore = existnstore.findExact('projectname',oldValue);
              if(nstore &lt; 0){
                  return true;
              }else{
                  return 'Job name already exist.';
              } 
          } 
      },
      listConfig: {
          getInnerTpl: function () {
              return '&lt;a class=&quot;search-item&quot;&gt;' +
                      '&lt;span&gt;{projectstate}&lt;/span&gt;' +
                      '{projectname}' +
                      '&lt;/a&gt;';
          }
      }, 
  });
  return combo; 
  }
  </code></pre>
  <p>any suggestions or opinions to do this :) thanks in advance..</p>