WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
Suggestion for form validation errors (5 posts)

  1. Dalton
    Member
    Posted 3 years ago #

    I love this plugin! I have one small suggestion, if you're interested. I don't know if you've considered this already, but I wanted to change the border of my fields to a different color if they didn't validate correctly. All I did was add the following line to scripts.js at line 130:

    into.addClass('missing-required');

    So it looks like this now:

    var into = $(this);
    into.addClass('missing-required');
    into.append('<span class="wpcf7-not-valid-tip">' + message + '</span>');

    And then I just added some simple CSS like this to my theme's stylesheet:

    span.missing-required input, span.missing-required textarea{
    	border: 1px solid red !important;
    }

    It's a small usability improvement, but I think it helps.

    Dalton

  2. Johan van der Wijk
    Member
    Posted 3 years ago #

    Thanks for the tip, this was exactly what I was looking for!

    Because I don't like hacking core plugin files I do hope this functionality will be incorporated in a future version of the plugin.

  3. Norm1
    Member
    Posted 3 years ago #

    Seriously, I could KISS you!!! I have been looking for exactly this thing!

  4. okoubaros
    Member
    Posted 3 years ago #

    i could too kiss you mate ... really! this is what i wanted .. btw i had to delet the line below the line you added

    from this
    var into = $(this);
    into.addClass('missing-required');
    into.append('<span class="wpcf7-not-valid-tip">' + message + '</span>');

    into this
    var into = $(this);
    into.addClass('missing-required');

    so i get only the red markup on the cells and not the msg!

  5. okoubaros
    Member
    Posted 3 years ago #

    any thoughts on how to fade the effect out like the plugin does?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic