HtmlEditorExtender和textbox多行与我的javascript函数冲突 [英] HtmlEditorExtender and textbox multiline has conflict with my javascript functions

查看:84
本文介绍了HtmlEditorExtender和textbox多行与我的javascript函数冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$(document).ready(function(){

$(input)。keydown(function(){

$(input)。 css(background-color,yellow);

});

$(input)。keyup(function(){

$(输入)。css(背景颜色,粉红色);

});

});



这个脚本适用于我的所有文本框..然后我添加这个



< asp:TextBox ID = txtMultiLinerunat =serverHeight =250pxWidth =100%Style =background-color:#FFF; display:inline; TextMode =MultiLineAutoCompleteType =已启用>



文本框txtMultiLine不受脚本影响。



然后我添加另一个脚本。

函数tagKeyWord(){

alert(yes);

}



这是针对我添加了onkeypress =tagKeyWord()的所有文本框运行的,包括TextboxtxtMultiLine..



然后我添加..

< asp:HtmlEditorExtender ID =txtHTMLContentArea_HtmlEditorExtenderrunat =serverEnabled =TrueTargetControlID =txtHTMLContentArea>



然后文本框txtMultiLineonkeypress事件不会触发。



我该怎么办?

HtmlEditorExtender和多行文本框很重要。因此,我必须找到一种方法,使用HtmlEditorExtender在多行文本框上运行我的脚本功能按键。



非常感谢任何形式的帮助。

问候。

$(document).ready(function () {
$("input").keydown(function () {
$("input").css("background-color", "yellow");
});
$("input").keyup(function () {
$("input").css("background-color", "pink");
});
});

this script is working for all my textboxes .. and then i add this

<asp:TextBox ID="txtMultiLine" runat="server" Height="250px" Width="100%" Style="background-color: #FFF; display: inline;" TextMode="MultiLine" AutoCompleteType="Enabled" >

Textbox "txtMultiLine" is not being affected by the script.

then i add another script.
function tagKeyWord() {
alert("yes");
}

and this is running for all the textbox that i added an onkeypress="tagKeyWord()" including Textbox "txtMultiLine" ..

and then i added ..
<asp:HtmlEditorExtender ID="txtHTMLContentArea_HtmlEditorExtender" runat="server" Enabled="True" TargetControlID="txtHTMLContentArea">

and then Textbox "txtMultiLine" onkeypress event doesn't trigger .

What will i do??
HtmlEditorExtender and the textbox being multiline is important. So I must find a way that my script function keypress running on a multiline Textbox with HtmlEditorExtender.

Any form of help is highly appreciated.
Regards.

推荐答案

(输入).keydown(function(){
("input").keydown(function () {


(输入)。css(background-color,yellow);

});
("input").css("background-color", "yellow");
});


(input)。keyup( function(){
("input").keyup(function () {


这篇关于HtmlEditorExtender和textbox多行与我的javascript函数冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆