Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    jQuery 1 div tag to display errors

    Hi

    Is it possible to use the same div tag so for example:

    Code:
    <span id=display_errors></span>
    to display error messages from my validation script for each individual input field?

    I want to put the div tag after every input field, so the relevant error message is right after the input field.

    I am using jQuery validation script I have written, and just want to keep CSS to a minimum, so I don't have to have a new div tag for displaying the errors for each input field.

    I not sure if its at all possible using jQuery as I am still fairly new to it, so any answers would be appreciated

    Many Thanks

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,092
    Thanks
    23
    Thanked 594 Times in 593 Posts
    This is not a div tag, it's a span and you can only have one(1) name as an ID to a page; classes can be plentiful.
    If you change that to a class=display_errors and can link that span to the input field, then should be no problem.
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."


  •  

    Tags for this Thread

    Posting Permissions

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