Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7963305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:34:50+00:00 2026-06-04T05:34:50+00:00

I am using jquery.validate.js plugin for a dialog validation. My problem is that I

  • 0

I am using jquery.validate.js plugin for a dialog validation. My problem is that I would like on submit only the first problematic field to get a class and the field error to be displayed as a tip in a fading out div next to the field. (write now the plug in adds labels on every field)

enter image description here

I hope I was clear enough!

Thank you in advance!!!

(if you need anything more please ask for it)

EDIT

The code for it

$("#wdw1003_useraddform").validate({
    rules : {
        wdw1003_username : {
            required : true
        },
        wdw1003_password : {
            required : true
        },
        wdw1003_fullname : {
            required : true
        },
        wdw1003_email : {
            required : true,
            email : true
        }
    },
    messages : {
        wdw1003_username : {
            required : "Field User Name is required"
        },
        wdw1003_password : {
            required : "Password is required"
        },
        wdw1003_fullname : {
            required : "Field Full Name is required"
        },
        wdw1003_email : {
            required : "Field E-mail is required",
            email : "Is not a valid e-mail"
        }
    }
});

EDIT after ankur20us comment

The form is generated with this lines

$form = new Form('useraddform', '#', $id."_");
$form -> setRequired('<img src="images/required.png" alt="Required" align="absmiddle" />', '<img src="images/required.png" alt="Required" align="absmiddle" />' . $trans -> translate('denotes required field'));
$form -> addElement('text', 'username', $trans -> translate('User Name'));
$form -> addElement('password', 'password', $trans -> translate('Password'));
$form -> addElement('text', 'fullname', $trans -> translate('Full Name'));
$form -> addElement('text', 'email', $trans -> translate('E-mail'));
$form -> addElement('select', 'perms', $trans -> translate('Permissions'), array('options' => $perms, 'value' => 'level1'));
$form -> addElement('select', 'status', $trans -> translate('Status'), array('options' => $status, 'size' => "1"));
$form -> addElement('textarea', 'comments', $trans -> translate('Comments'));
$form -> addElement('select', 'lang', $trans -> translate('Language'), array('options' => $langs, 'size' => "1"));
$form -> addElement('submit', 'submit', $trans -> translate('Create User'), array('style' => "clear:both; float:right; margin-right: 8%;"));

The javascript above comes out of these lines

     $form -> addRule('username', 'required', $trans -> translate('Field User Name is required'));
$form -> addRule('password', 'required', $trans -> translate('Password is required'));
$form -> addRule('fullname', 'required', $trans -> translate('Field Full Name is required'));
$form -> addRule('email', 'required', $trans -> translate('Field E-mail is required'));
$form -> addRule('email', 'email', $trans -> translate('Is not a valid e-mail'));

So I can not change much!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:34:51+00:00Added an answer on June 4, 2026 at 5:34 am

    Here is the solution I found. I created a hidden div into my page like this

    <div id="validationMessageBox" class="ui-corner-all" style="display: none;">
        <div id="validationMessageBoxSymbol" class="ui-icon ui-icon-alert"></div>
        <div id="validationMessageBoxMessage"></div>
    </div>
    

    Then I used showErrors:function(errors) of the jquery.validate API to display the hidden div updating it’s message and positioning it next to the first missing element. and finaly a fadeout.

    The final code is below.

    $("#wdw1003_useraddform").validate({
        rules : {
            wdw1003_username : {
                required : true
            },
            wdw1003_password : {
                required : true
            },
            wdw1003_fullname : {
                required : true
            },
            wdw1003_email : {
                required : true,
                email : true
            }
        },
        messages : {
            wdw1003_username : {
                required : "Field User Name is required"
            },
            wdw1003_password : {
                required : "Password is required"
            },
            wdw1003_fullname : {
                required : "Field Full Name is required"
            },
            wdw1003_email : {
                required : "Field E-mail is required",
                email : "Is not a valid e-mail"
            }
        },
        showErrors : function(errors) {
            var error = this.errorList[0];
            if(undefined != error) {
                var $element = $(error.element);
                var message = error.message;
                $element.addClass("ui-state-error");
                $("#validationMessageBox").addClass("ui-state-error").css({
                    left : $element.offset().left + $element.width() + 15,
                    top : ($element.offset().top)
                });
                $("#validationMessageBoxMessage").html(message);
                $("#validationMessageBox").show("fast");
                $element.removeClass("ui-state-error", 2000);
                $("#validationMessageBox").fadeOut(2000);
            }
        },
        onclick : false,
        onkeyup : false,
        onfocusout : false
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that is using jQuery Validate plugin for client side validation,
I'm using the jQuery validate plugin, and would like to return a random value
I am using the jQuery.validate plugin but I would like to change the background
I'm using the jQuery validate plugin to validate a multi-step form like this one:
I am using the jQuery validate plugin . My error labels are styled like
I'm using the validate plugin from http://bassistance.de/jquery-plugins/jquery-plugin-validation/ What i'm trying to find is a
I'm using jQuery Validate and would like to re-validate a group of fields whenever
I am using asp.net mvc 2.0 and jquery validate 1.7 ( http://bassistance.de/jquery-plugins/jquery-plugin-validation/ ) What
i'm using jQuery validate() plugin to validate a form. it does the validation but
I'd like to validate a form using the jquery validate plugin, but I'm unable

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.