title: Disable/ enable dynamically input/ textarea/ select fields with jQuery
body: <p>I have the following code with three options in a select box which should dynamically enable/disable the attribute "disable" in the input fields/ textarea / select, but the code doesn't work at all:</p>
  
  <pre><code> $(document).ready(function() {
  $('.fieldcontent').not('.info').hide();
  $('#selector_cs').change(function() {
  
        $('.fieldcontent').customFadeOut(100);
        $('.' + $(this).val()).customFadeIn(900);
       // $('input').prop('disabled',false);
      //$('textarea').prop('disabled',false);
      //$('select').prop('disabled',false);
   //option1
   if ($("this:selected").val() === 'help') {
  $("textarea[name='message']").prop('disabled',false);
  $("input[name='domain']").prop('disabled',false);
  }else{
      $("textarea[name='message']").prop('disabled',true);
  $("input[name='domain']").prop('disabled',true);
      };
      //option2
       if ($("this:selected").val() === 'info') {
  $("textarea[name='message']").prop('disabled',false);
  
  }else{
      $("textarea[name='message']").prop('disabled',true);
  };
       //option3
       if ($("this:selected").val() === 'products') {
  $("textarea[name='message']").prop('disabled',true);
  $("select[name='products']").prop('disabled',false);
  $("input[name='domain']").prop('disabled',false);
  $("input[name='address']").prop('disabled',false);
  $("input[name='state']").prop('disabled',false);
  $("input[name='city']").prop('disabled',false);
  $("input[name='country']").prop('disabled',false);
  };      
  });  });
  </code></pre>
  
  <p>Can anyone help me to write the code properly?</p>
  
  <p>Thanks in advance for any help</p>
  
  <p><strong>EDIT:</strong> Thanks @Ken and @arun for the quick help. Now the jQuery is working.</p>
  
  <p>But: I have a PHP validation which doesn't pass with the fiedls disabled by jQuery. Why?</p>
  
  <p>Otherwise, i don't want to add/ remove dynamic hidden fields by jquery, because when the user receive a mail, he would see the hidden fields values, which aren't "real" values, but with values like "some1", "some2" ecc.</p>
  
  <p>How to avoid this and using diasabled fields instead passing the php validation?</p>