Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Testing to see if one element exists inside another
Old 01-07-2011, 08:12 AM Testing to see if one element exists inside another
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
I've coded a very basic script to display any form that contains a specific child element, like so:

Code:
// keep the contact form open if any error messages are present
$(document).ready(function() {
    $('#content .gform_wrapper').each(function() {
        if($(this).find('.validation_error')) {
            $(this).show();
        }
    });
//    location.href = location.href+'#gform_7';
});
But it just displays every form even if it doesn't contain '.validation_error' ! Does anybody know why? Is the find() method not valid to use in this way?
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Reply     « Reply to Testing to see if one element exists inside another
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.43078 seconds with 12 queries