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 8141675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:35:26+00:00 2026-06-06T12:35:26+00:00

I am validating value entered in textbox against database and wanted to show right

  • 0

I am validating value entered in textbox against database and wanted to show right or wrong icon correct text box.

Here my html code goes

<tr>
 <td><input type="textbox" class="process-order serial" name="serialNumber" id="serialNumber"/> <span name="validsn" id="validsn">
</td>
</tr> 
<tr>
<td><input type="textbox" class="process-order serial" name="serialNumber" id="serialNumber"/> <span name="validsn" id="validsn">
</td>
</tr> 
<tr>
<td><input type="textbox" class="process-order serial" name="serialNumber" id="serialNumber"/> <span name="validsn" id="validsn">
</td>
</tr> 

I am validating onblur when value entered in serialNumber field, I will get true or false and in jquery I am doing this way.

$.post("validateSN", {value:$(this).val()},function(data){
    $("#validsn").text(data);
});

when I am displaying data every time error message or success message appears only beside first one.

UPDATE: the SerialNumber textboxes are dynamic and same as the span as per text box sizes.

Can someone please help me correct way to show error/success message beside each text box correctly.

  • 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-06T12:35:28+00:00Added an answer on June 6, 2026 at 12:35 pm

    I have followed Jigar Joshi suggestion and modified little bit

    Onblur

    $(".serial").live("blur", function(){
    //got the index of textbox where serial number is entered
    var index = $(".serial").index(this);
    
    $.ajax({
     url:"validateSN",
     data: "value="+sn,
     success : function(data){
     $("#validsn"+index).show();
         if(data=="true"){
        $("#validsn"+index).attr('src',"images/icons/valid_icon.png");
         } else if(data=="false"){
            $("#validsn"+index).attr("src", "images/icons/invalid_icon.png");
         }
    });
    

    Then it worked very well. Thank you Jigar Joshi for help me moving forward.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm validating a textbox for valid email with this: <asp:RegularExpressionValidator ID=RegularExpressionValidator1 ControlToValidate=txtMailCustom Text=Invalid address
I'm validating a text field in my form as follows: $name = new Zend_Form_Element_Text('name');
I have a text box that I would like to do some validation on.
What's the best way of validating an HTML text input as it's typed? All
i have a text box that's required. when user clicks the submit button, the
my text box takes only numeric values,from 0 to 255 (1 byte),how can i
I have a text box which accepts time(max of 5 characters only), and a
I have 2 textbox controls where date values will be entered. I want it
I am entering values(URLs) in the text box and when I click the next
Is it safe to query with object.get without escaping or validation user submitted value?

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.