在客户端怎么用JS得到CuteEditor的值,用了好多办法怎么得不到啊.
有谁做过.急............. --------------------编程问答-------------------- 顶一下,怎么没有人回答我啊. --------------------编程问答-------------------- 搞定马上给分 --------------------编程问答----------------------------------------编程问答-------------------- 我试的看看 --------------------编程问答--------------------
var id='<%=MyCuteEditor.ClientID %>'; //把MyCuteEditor改成你的CuteEditor实例的Id
var myCuteEditor=document.getElementById(id);
var txt=myCuteEditor.value; //txt是你要的值
document.all('CuteEditor').value
这样拿不到么? --------------------编程问答-------------------- 好像不行啊,是不是努力还要设置一下 --------------------编程问答-------------------- 拿不到的 --------------------编程问答-------------------- CuteEditor是服务器控件吗?
--------------------编程问答-------------------- var id='<%=memo.ClientID %>'; //把MyCuteEditor改成你的CuteEditor实例的Id
var myCuteEditor=document.getElementById(id);
var txt=myCuteEditor.value; //txt是你要的值
var b=document.getElementById("memo").value;
这样都没有,
TXT得到un
b得到的是"". --------------------编程问答-------------------- CuteEditor,是一个文本编辑器.
<CE:Editor ID="memo" runat="server" Width="977px" AutoConfigure="Gecko" EditorOnPaste="Default" AutoParseClasses="True" CodeViewTemplateItemList="Save,Print,Cut,Copy,Paste,Find,ToFullPage,FromFullPage,SelectAll" MaxHTMLLength="0" MaxTextLength="0" Height="229px">
<FrameStyle BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
CssClass="CuteEditorFrame" Height="100%" Width="100%" />
</CE:Editor> --------------------编程问答--------------------
--------------------编程问答--------------------
var id=' <%=memo.ClientID %> '; //把MyCuteEditor改成你的CuteEditor实例的Id
var myCuteEditor=document.getElementById(id);
var txt=myCuteEditor.value; //txt是你要的值
var b=document.getElementById(id).value; //晕,这里应该是id,你都没按我说的做,id现在是客户端的id
--------------------编程问答-------------------- 得到,兄弟,要不,你在本机试的看看.我的QQ:12392067,你远程来我机试的看看 --------------------编程问答-------------------- 兄弟,算你好运。我也正为CuteEditor在page_Load无法注册onkeyup事件烦恼。刚好看到这个问题。
var id='<%=memo.ClientID %>'; //把memo是你的CuteEditor实例的Id
var myCuteEditor=document.getElementById(id);
var txt=myCuteEditor.value; //txt是你要的值
============================
var editwin = editor1.GetWindow();
Getting the active editor document
In order to find the active editor document, you'd write:
// get the active editor document
var editdoc = editor1.GetDocument();
Getting the active editor selection
In order to find the active editor selection, you'd write:
// get the active editor selection
var sel = editor1.GetSelection();
Method Description
getHTML() This method is used for retrieving the content of Cute Editor as HTML.
Example:
// get the cute editor instance
var editor1 = document.getElementById('<% = Editor1.ClientID%>');
// retrieving the content of Cute Editor as HTML
var content = editor1.getHTML();
alert(content );
SetHTML() This method is used for setting the content of Cute Editor.
Example:
// get the cute editor instance
var editor1 = document.getElementById('<% = Editor1.ClientID%>');
// setting the content of Cute Editor
editor1.setHTML("Hello World");
PasteHTML() This method is used for pasting the specified HTML into a range within a editor document. If anything is selected, the selection is replaced with the new HTML and text.
Example:
// get the cute editor instance
var editor1 = document.getElementById('<% = Editor1.ClientID%>');
// pasting the specified HTML into a range within a editor document
editor1.pasteHTML("Hello World");
FocusDocument() This method is used for setting input focus to Cute Editor
Example:
// get the cute editor instance
var editor1 = document.getElementById('<% = Editor1.ClientID%>');
// setting input focus to Cute Editor
editor1.FocusDocument();
--------------------编程问答-------------------- 上面是用内置的js功能来实现的。有获取有设置它的值有获取焦点三大功能。自己看下。再不行。我就无语了。
另外如果借你的宝帖,要是谁知道怎么在page_Load中通过attribute.add来注册onkeyup事件的化,说下好吗?
补充:.NET技术 , ASP.NET