How to hide Default values using Drupal Behaviour I have created a form using the web form module. In this form i have 3 field. Name, Email and Phone. I have set the default values for Name as Name , Email as E-mail and Phone as Phone (Done this using the form settings). 

Now the scenario is, when the user clicks on the Name field , The default values has to go off. I tried this using jQuery but it didnt work. So i thought of using Drupal Behaviours with jQuery.

This is my code 

(function (jQuery) { 
 Drupal.behaviors.amendor = {
    jQuery('edit-submitted-phone').focus(function() {
      alert('Chekcing the values');
      if (jQuery('edit-submitted-phone').val() == 'edit-submitted-phone'.defaultValue) {
        jQuery('edit-submitted-phone').val('');
      }
    });

    jQuery('edit-submitted-phone').blur(function() {
      alert('setting the values');
      if (!jQuery('edit-submitted-phone').val()) {
        jQuery('edit-submitted-phone').val('edit-submitted-phone'.defaultValue);
      }
    });
  };
})(jQuery);
To start with, as you're namespacing jQuery you can use the $ instead of jQuery inside the (function (jQuery) { ... });

Secondly, you're not pointing to classes or ID's in your jQuery.  I'm pretty sure that edit-submitted-phone should be #edit-submitted-phone in every instance in your code.

If this doesn't work, then let me know and I'll see what else I can come up with.