tags:

views:

36

answers:

0

I am working on java script validaion I am using TinyMCE editor in HTML to enter the description I have made the following validation

function validateAdd(){
                var title = document.aboutAddForm.contentTitle.value;

                var description = tinyMCE.get('contentDescription').getContent();
                if(title == "" || title == null ){
                    alert(" please enter title");
                    return false;
                    }
                if(description == '' || description == null ){
                    alert(" please enter description");
                    return false;
                    }
                document.aboutAddForm.submit();
            }

but still when I dont eneter information for title in text field it gives proper message title field but when I dont enter any information in tinyMCE editor it gives me error alert but still form gets submitted