WordPress.org

Ready to get started?Download WordPress

Forums

Adding Javascript Library (Livevalidation) (2 posts)

  1. AlokeDesai
    Member
    Posted 1 year ago #

    I'm trying to get livevalidation (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.

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic