Hello and welcome to our community! Is this your first visit?
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
    Thanked 0 Times in 0 Posts

    jQuery 1 div tag to display errors


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

    <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. #2
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Thanked 1,013 Times in 1,010 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.
    Physics is actually atoms trying to understand themselves.


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