View Single Post
Old 11-02-2011, 06:56 PM   PM User | #7
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,817
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
Try:

Code:
<script type="text/javascript">
    $(document).ready(function() {
if ($("#editModeFailedToValidate").length>0){
            alert('The Edit-Key did not match, Please try again.');
}
    });
</script>
I think I'm right in saying jQuery always returns a selector object regardless of whether a match is found - so if($("#editModeFailedToValidate")) will always return true. Adding the .length property will evaluate the object and its result can then be tested.

Last edited by SB65; 11-02-2011 at 06:59 PM..
SB65 is offline   Reply With Quote