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

  • Home
  • SEARCH
  • 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 691747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:34:40+00:00 2026-05-14T02:34:40+00:00

Greetings, I have problem with errorPlacement, I’m trying to place the error message next

  • 0

Greetings,

I have problem with errorPlacement, I’m trying to place the error message next to the field but it appearing on the top of the page.

any advice how to fix this problem??

here is my code:

<%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="IMAM_APPLICATION.WebForm1" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">


    <script src="js/jquery-1.4.1.js" type="text/javascript"></script>

    <script src="js/jquery.validate.js" type="text/javascript"></script>


    <script type="text/javascript">

        $(document).ready(function() {
            $("#aspnetForm").validate({
                groups: {
                    username: "fname lname",
                    address: "address1 phone"
                },
                errorPlacement: function(error, element) {
                    if (element.attr("name") == "fname"
|| element.attr("name") == "lname")
                        error.insertAfter("#lastname");
                    else
                        error.insertAfter(element);
                },
                debug: true
            })
        });

    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">

    <p style="height: 313px">


              <label style="position:absolute; top: 227px; left: 22px;">Your Name</label>
&nbsp;<input name="fname" value="Pete"
                  style="position:absolute; top: 226px; left: 102px;"/>
<input name="lname" id="lastname"
                  style="position:absolute; top: 264px; left: 95px;"/>
<input name="address1" style="position:absolute; top: 347px; left: 102px;"/>
<input name="phone" id="lastname"
                  style="position:absolute; top: 315px; left: 102px;"/>
<br/>
<input type="submit" value="Submit Name" style="position:absolute; top: 407px; left: 73px;"/>
<input type="submit" value="Submit Address"
                  style="position:absolute; top: 370px; left: 437px;"/>

    </p>




    </asp:Content>
  • 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-05-14T02:34:40+00:00Added an answer on May 14, 2026 at 2:34 am

    This is because all of your elements are absolutely positioned. You can’t put place an error with something outside the normal flow unless it or it’s container are absolutely positioned as well.

    To use errorPlacement like you want, you need to use a different style than position:absolute; top: 315px; left: 102px; on your elements. A absolutely positioned layout, unless necessary, it always going to be messy at best to maintain or insert things into.

    To get close in this case you could do something like:

    error.css({position:'absolute', top: '226px',left: '182px'})
         .insertAfter("#lastname");
    

    But…I’d change the layout.

    Also, you have another element with the same ID, make sure to update this so your IDs are unique:

    <input name="phone" id="lastname"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings, here is the problem. I have a page called entList.jsp , that works
Greetings again, I have this problem again on C but now using struct. Having
Greetings, Here's the problem I'm having. I have a page which redirects directly to
Greetings, I have a problem using jqgrid and jquery tab (I am coding in
Greetings, I have to following problem. I have a WCF Service which runs under
Greetings! I'm trying to have a UIWebView controlled from generated events. Is there a
greetings all i have a problem that when sending an email from the server
Greetings, I have a problem as follows: I have an SQL variable declared: DECLARE
Greetings, I have a problem which would seem to involve some kind of z-index
I have a similar problem as already solved here . But I can not

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.