Title: Remove default values
Last modified: August 21, 2016

---

# Remove default values

 *  Resolved [amandapiasta](https://wordpress.org/support/users/amandapiasta/)
 * (@amandapiasta)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/remove-default-values/)
 * I would like the default values in my form to be removed when that element is
   focused on, but not if something different has been written on blur.
 * I have been using this code for other forms, but it doesn’t work when I put it
   into the Responsive Contact Form script area:
 *     ```
       //remove form values when user clicks in the field.
         $('.rmv-dft-val').click(
       		function() {
       			if (this.value == this.defaultValue) {
       				this.value = '';
       			}
       		}
       	);//close on click
   
       	$('.rmv-dft-val').blur(
       		function() {
       			if (this.value == '') {
       				this.value = this.defaultValue;
       			}
       		}
       	);// close on blur
       ```
   
 * The website is [http://taragaucher.com/directory/contact/](http://taragaucher.com/directory/contact/)
 * [http://wordpress.org/plugins/responsive-contact-form/](http://wordpress.org/plugins/responsive-contact-form/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [August Infotech](https://wordpress.org/support/users/augustinfotech/)
 * (@augustinfotech)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/remove-default-values/#post-4346781)
 * Hello amandapiasta,
 * please try removing functions onblur=”replace[field name]()” from Plugins\responsive-
   contact-form\include\ai-contact-form-template.php page and include your script
   in same page,
    and please correct errors in input fields, spacing before and 
   after attributes as I found it on your site.
 * If you still find any trouble, please let us know.
 * Regards,
    August Infotech
 *  Thread Starter [amandapiasta](https://wordpress.org/support/users/amandapiasta/)
 * (@amandapiasta)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/remove-default-values/#post-4346784)
 * Hi August,
 * thanks for the reply. Where does the extra space come from? I have no idea why
   that is there. I am viewing it in developer tools for chrome and it shows me 
   something like this:
 *     ```
       <div class="control-group message">
         :before
       <label class="control-label" for="ai_comment">...</label>
       <div class="controls">...</div>
         :after
       </div>
       ```
   
 * I assume you are talking about the :before and :after spots …but I don’t know
   where those are being inserted.
 *  Thread Starter [amandapiasta](https://wordpress.org/support/users/amandapiasta/)
 * (@amandapiasta)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/remove-default-values/#post-4346785)
 * Well i figured out how to remove the previous stated :before and :after … they
   were included from the contact.css
 * It still does not seem to be working… seems to be another javascript error because
   if I do not include my code it works, but if I add it in, it doesn’t work. :/
 * I have added the following in ai-contact-form-template.php above the functions:
 *     ```
       $(document).ready(function() {
       	//remove form values when user clicks in the field.
       	  $('.rmv-dft-val').click(
       			function() {
       				if (this.value == this.defaultValue) {
       					this.value = '';
       				}
       			}
       		);//close on click
   
       		$('.rmv-dft-val').blur(
       			function() {
       				if (this.value == '') {
       					this.value = this.defaultValue;
       				}
       			}
       		);// close on blur
       	});
       ```
   
 *  Plugin Author [August Infotech](https://wordpress.org/support/users/augustinfotech/)
 * (@augustinfotech)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/remove-default-values/#post-4346812)
 * Hello amandapiasta,
 * We have found below jquery error in your contact page.
    Error: TypeError: $ is
   not a function Source File: [http://taragaucher.com/directory/contact/](http://taragaucher.com/directory/contact/)
   Line: 7254
 * Solution is : put jQuery instead of $
    Kindly check and put below code in your
   template.
 *     ```
       jQuery(document).ready(function() {
       	//remove form values when user clicks in the field.
       	  jQuery('.rmv-dft-val').click(
       			function() {
       				if (this.value == this.defaultValue) {
       					this.value = '';
       				}
       			}
       		);//close on click
   
       		jQuery('.rmv-dft-val').blur(
       			function() {
       				if (this.value == '') {
       					this.value = this.defaultValue;
       				}
       			}
       		);// close on blur
       	});
       ```
   
 *  Thread Starter [amandapiasta](https://wordpress.org/support/users/amandapiasta/)
 * (@amandapiasta)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/remove-default-values/#post-4346816)
 * Sweet, it works!
 * Thanks August!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Remove default values’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/responsive-contact-form_191919.svg)
 * [Multi-language Responsive Contact Form](https://wordpress.org/plugins/responsive-contact-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/responsive-contact-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/responsive-contact-form/)
 * [Active Topics](https://wordpress.org/support/plugin/responsive-contact-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/responsive-contact-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/responsive-contact-form/reviews/)

## Tags

 * [form](https://wordpress.org/support/topic-tag/form/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)

 * 5 replies
 * 2 participants
 * Last reply from: [amandapiasta](https://wordpress.org/support/users/amandapiasta/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/remove-default-values/#post-4346816)
 * Status: resolved