Title: Adding Javascript Library (Livevalidation)
Last modified: August 20, 2016

---

# Adding Javascript Library (Livevalidation)

 *  [AlokeDesai](https://wordpress.org/support/users/alokedesai/)
 * (@alokedesai)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/adding-javascript-library-livevalidation/)
 * I’m trying to get livevalidation ([http://livevalidation.com/](http://livevalidation.com/))
   to work on my wordpress site but I can’t seem to get it to work. I added the 
   js file to my header.php file between the meta and style tags and I have the 
   following code on the page that contains the form:
 *     ```
       <script>
           var f1 = new LiveValidation('d_fn');
           f1.add(Validate.Exclusion, {within:['First Name']});
           f1.add(Validate.Presence);
   
           var f2 = new LiveValidation('d_ln');
           f2.add(Validate.Presence);
           f2.add(Validate.Exclusion, {within:['Last Name']});
   
           var f3 = new LiveValidation('d_s1');
           f3.add(Validate.Presence);
   
           var f4 = new LiveValidation('d_cy');
           f4.add(Validate.Presence);
   
           var f5 = new LiveValidation('d_phone');
           f5.add(Validate.Length, {is:10});
   
           var f6 = new LiveValidation('d_email');
           f6.add(Validate.Email);
   
           var f7 = new LiveValidation('d_pw1');
           f7.add(Validate.Presence);
   
           var f8 = new LiveValidation('d_pw2');
           f8.add(Validate.Confirmation, {match: 'd_pw1'});
          </script>
       ```
   
 * This code works perfectly outside of wordpress, btw.

Viewing 1 replies (of 1 total)

 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/adding-javascript-library-livevalidation/#post-3375756)
 * [http://codex.wordpress.org/Using_Javascript](http://codex.wordpress.org/Using_Javascript)

Viewing 1 replies (of 1 total)

The topic ‘Adding Javascript Library (Livevalidation)’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/adding-javascript-library-livevalidation/#post-3375756)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
