Basically I have something like this:
<script>
function myfunction(){
var data = CKEDITOR.instances.editable.getData();
alert(data);
}
</script>
What I want to do is, if data does not match this:
<h2>Any text allowed here but only text<h2>
I want to warn the user.
How can I do this?
Thank you..
I will edit my question, I guess it was not clear enough..
the data variable is read from somewhere. It is not important.
When a button is clicked, this function is called.
The data variable ( which is a string ) can only be something like this:
<h2> ANY TEXT HERE </h2>
So these are not allowed:
Anytext
<h1>any text</h1>
<a href=..>
Thank you.
Version 1:
This will prevent any numbers but accept only plain letters.
Version 2:
Which will accept A-Za-z only inbetween tags
Version 3:
This will accept anything except numbers and to prevent any closing tags