views:

88

answers:

2

I have this code inside a form of mine:

<textarea>Your message</textarea> 

The html content of the tag will be emptied on focus.

I want to run some validation on this field with jQuery. First, the value of this field should not be = "". Secondly, the content of the tag should not be = "Your message".

Anyone knows how I can archive this in the most efficient way?

+1  A: 

I would recommend using jQuery validation plugin which can be found at bassisance.de

azatoth
ok, im trying the plugin. Thanks!
Espen Arnoy
+1  A: 

Try

$('form').submit(function(){
    var form=$(this);
    var text=form.find('textarea');
    if(text!="" && text!="Your message"){
        return true;
    }else{
        return false;
    }
    });
Olly Hicks