本文介绍了FCKeditor onBlur和按键检查非英文字符javascript,C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#中使用FCK编辑器v.2.6.6.我想检查用户是否在FCK内容中输入了非英语字符
用于我用作
的文本框

I am using FCK editor v.2.6.6 in C#. I want to check if user entered other than English character in FCK content
for a textbox i used as

<asp:TextBox ID="TextBox1" runat="server" Text=''<%# Bind("headline") %>'' Width="250px" Visible=true onkeypress ="return suppressNonEng(event)" onblur="suppressOnBluer(this)"></asp:TextBox>


我的JavaScript是


my javascript is

function  suppressNonEng(e)
 {
   var key;
   if(window.event)  key = window.event.keyCode;     //IE
   else  key = e.which;     //firefox

   if(key >128)  return false;
   else  return true;
 }

 function suppressOnBluer(e)
 {
     var s= e.value;
     e.value = '';
     for(i=0;i<s.length;i++)
          if (s.charCodeAt(i)<=128)
          {

           e.value += s.charAt(i);
             }
             if(s.length!=e.value.length)
             {
             alert('Other than english character are not supported')
             }

         
 }



如何也在FCK Editor V 2.6.6中检查内容?
请帮我解决这个问题.
在此先谢谢您.



How to check contents in FCK editor V 2.6.6 too ?
Please help me to resolve this.
Thanks in Advance.

推荐答案


这篇关于FCKeditor onBlur和按键检查非英文字符javascript,C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 18:35