SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Non-Member
    Join Date
    Nov 2010
    Posts
    220
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem in the jQuery validation

    All of items (.result_username, .result_password ,.result_capcher) are show step by step, after every click on submit .
    To display en masse (all: .result_username, .result_password ,.result_capcher) I do?

    It is a jQuery validation:
    Code:
    $("#login_submit").click(function () {
             event.preventDefault();
             var username = $("#input_username").val();
             var password = $("#input_password").val();
             var capcher = $("#input_code").val();
                if(!username){
                $('.result_username').html('<div class="not_ok"></div>'); 
             }
             else if(!password){
                $('.result_password').html('<div class="not_ok"></div>'); 
             }
             else if(!capcher){
                $('.result_capcher').html('<div class="not_ok"></div>'); 
             }
        });

  2. #2
    SitePoint Zealot Gar onn's Avatar
    Join Date
    Feb 2011
    Location
    Belgium
    Posts
    130
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry I don't understand your question

  3. #3
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,095
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Remove the else on the second and third ifs, so you just get if, if, if instead of if, else if, else if
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •