thefrozencoder

Programming and Technology blog

TinyMCE, ASP.NET and validation

The following describes how to use a custom validator function along side TinyMCE to validate the contents of the textarea.

Add the custom validator and setup the properties as you normally setting the ControlToValidate to the ID of the textarea and the ClientValidationFunction to the function name you see below (this can be changed of course).

The key is to call TinyMCE's triggerSave() method so the editor can synch up to the underlying textarea. Once this is done the textarea now has content.

<script language="JavaScript" type="text/javascript">
function validateTinyMCEText(source, args) {   
var txt = document.getElementById(source.controltovalidate);
tinyMCE.triggerSave();
args.Value = (txt.value.replace(/^W+/,'')).replace(/W+$/,'');
args.IsValid = (args.Value != '');}
</script>

Hopefully this will help out a few people

Microsoft, Vista, Server 2008 and Me

Seems that everyday you hear about Vista and how poorly it is doing when it comes to adoption and basic performance. It also seems that end users are not the only ones that are crying the Vista blues, even MS’s own employees are now getting on the band wagon.

Well sort of...

There are several documents showing up on the internet as well as Microsoft’s own MSDN blog sites on how to make Windows 2008 into a super desktop OS. I guess if Microsoft’s own employees are scoffing at Vista then it must be true. Vista is as big a flop as the PS3. But for all you MS fanboys out there Windows 7 is churning full steam ahead and will probably be a smash hit. Why you ask?

Windows 3.0 = Bad
Windows 3.11 = Better
Windows 95 = Bad
Windows 98 = Better
Windows ME = Bad
Windows XP = Better
Windows Vista = Bad
Windows 7 = ?????

Get the point?