Ulteriore revisione...
codice:
<%
sTableName = request.querystring("table")
strName = request.querystring("name")
sWhere = request.querystring("where")
cid = request.querystring("cid")
OpenRS arrConn(cid)
sSQL = "SELECT [" & strName & "] FROM [" & sTableName & "]" & sWhere & ";"
rs.Open sSQL, , , adCmdTable
for each fld in rs.fields
fldVal = fld.value
next
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script language="JavaScript" src="yusasp_ace.js"></script>
<script language="JavaScript" src="yusasp_color.js"></script>
<script>
var obj1 = new ACEditor("obj1")
obj1.width = "100%" //editor width
obj1.height = 300 //editor height
obj1.AssetPageURL = "default_Asset.asp" //specify Asset library management page
obj1.ImagePageURL = "default_image.asp" //specify Image library management page
obj1.base = "127.0.0.1/net/file/" //where the users see the content (where we publish the content)
obj1.baseEditor = "127.0.0.1/net/file/" //location of the editor
obj1.StyleSelection = "ace_styleselection.css"; //use style selection
obj1.StyleSelectionPath_RelativeTo_EditorPath = "../style/"; //location of style selection css file (relative to the editor)
obj1.PageStyle = "ace_document.css"; //apply external css to the document
obj1.PageStylePath_RelativeTo_EditorPath = "../style/"; //location of the external css (relative to the editor)
obj1.isFullHTML = false //edit full HTML (not just BODY)s
obj1.RUN() //show
function LoadContent(){
//STEP 6: Use putContent() method to to put the hidden Textarea value into the editor.
obj1.putContent(idTextarea.value)
}
//STEP 10: prepare submit FORM function
function SubmitForm(){
//STEP 11: Before getting the edited content, the display mode of the editor
//must not in HTML view.
if(obj1.displayMode == "HTML"){
alert("Please uncheck HTML view");
return ;
}
//STEP 12: Here we move the edited content into the input form we've prepared before.
Frm.body.value = obj1.getContentBody()
//STEP 13: Form submit.
Form1.submit();
window.close();
}
</script>
</head>
<!-- STEP 5: After this page is fully loaded (means that the content from the database is ready in the textarea)
then we have to copy the content from the textarea into the editor. We do this on event body onload, by call a function named LoadContent() -->
<body onload="LoadContent()" style="font:10pt verdana,arial,sans-serif">
<form method="post" action="????" name="SaveForm" ID="Form1">
<INPUT type="button" value="S A V E" onclick="SubmitForm()" ID="Button1" NAME="Button1">
<TEXTAREA rows=7 cols=40 ID="idTextarea" NAME="idTextarea" style="display:none">
<%=fldVal%>
</TEXTAREA>
</form>
</body>
</html>