Vi taler ikke forbi hinanden, det vil ikke hjælpe dig for der står det samme som for oven... Det er vist et meget langt javascript som driller. Har dog gjort det alligevel så du kan se hvad jeg mener!
Jeg har dog "løst" problemet med replace(Text,"®","&Reg")...
-----------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script language="JavaScript">
<!--
function popLoad() {
var myLeft = (screen.availWidth - 568) / 2;
var myTop = (screen.availHeight - 232) / 2;
window.open("BannerTop.asp?ID=512&BannerID=1","Upload","width=568,height=232,left="+myLeft+",top="+myTop+",toolbar=No,menubar=No,location=No,scrollbars=No,resize=Yes");
}
//-->
</script>
<!-- STEP 1: include js files -->
<script language="JavaScript" src="include/yusasp_ace.js"></script>
<script language="JavaScript" src="include/yusasp_color.js"></script>
<script>
function Send(SaveForm)
{
//STEP 9: 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 (false);
}
//STEP 10: Here we move the edited content & style into form fields.
Form1.txtContent.value = obj1.getContentBody() //move edited content into form field, to be submitted.
Form1.txtPageProperties.value = obj1.getPageCSSText() //move page properties css Text/style into form field, to be submitted.
//STEP 11: You can perform validation here if needed.
if (Form1.txtTitle.value == "")
{
alert("Please fill the document Title.");
return (false);
}
return (true);
}
function LoadContent()
{
popLoad();
//STEP 5: Use putContent to fill editor area.
//Note: we put content (from database) into hidden area (divResult),
//so that we can use method putContent(..HTML content here..)
//to move the content from divResult into editor area.
obj1.putContent(divResult.value) //Put Content into the editor
obj1.setPageCSSText(divProperties.value) //apply page properties
}
</script>
<link href="style.css" rel="stylesheet" media="screen">
</head>
<body onload="LoadContent()" style="font:10pt verdana,arial,sans-serif" leftmargin="0" marginwidth="0">
<div align="center">
<form method="post" action="admin_DocEdit.asp?action=save" name="SaveForm" id="Form1" onsubmit="return Send(this);">
<div align="center">
<table style="table-layout:fixed;font-family:Verdana,Arial,Helvetica;font-size:8pt;" width=760 id="Table2">
<col width=760>
<col>
<tr><!-- STEP 7: Prepare FORM fields (txtTitle & txtDocumentID)
and fill the fields with value from Database -->
<td bgcolor="#bcd3dd">
<table width="760" border="0" cellspacing="0" cellpadding="5">
<tr>
<td valign="bottom" rowspan="2"><img src="include/default/artikel.gif" width="38" height="11" border="0"><br>
<input class="inputfelt" type="text" id="txtTitle" name="txtTitle" value="test" size=50></td>
<td width="150" rowspan="2" valign="middle">
<div align="right"><a href="#" onclick="popLoad()"><img src="include/default/RetBanner.gif" width="125" height="40" border="0"></a></div>
</td>
<td rowspan="2" width="100" valign="middle">
<div align="right">
<a href="default.asp"><img src="include/default/SiteCom.gif" width="100" height="40" border="0"></a></div>
</td>
</tr>
<tr height="23">
</tr>
</table>
</td>
</tr>
<tr>
<td><input type="hidden" name="txtDocumentID" id="txtDocumentID" value="512"> <!-- STEP 8: Since we edit content within editor that is not part of the FORM,
we need to move the edited content & its style into
fields within a FORM.
Here we prepare 2 hidden form fields :
- txtContent for edited content, and
- txtPageProperties for its style. --><input type="hidden" name="txtContent" value="" id="Hidden1"> <input type="hidden" name="txtPageProperties" value="" id="txtPageProperties"> <!-- STEP 2: Attach Editor --> <script>
var obj1 = new ACEditor("obj1")
obj1.width = "100%" //editor width
obj1.height = 500 //editor height
obj1.AssetPageURL = "default_Asset.asp" //specify Asset library management page
obj1.ImagePageURL = "default_image.asp" //specify Image library management page
obj1.base = "
http://demo.pajortest.dk/" //where the users see the content (where we publish the content)
obj1.baseEditor = "
http://demo.pajortest.dk/admin/" //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
</script></td>
</tr>
<tr>
<td>
<div align="right">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
</td>
<td>
<div align="right">
<input type="image" src="include/default/gem.gif" border="0" alt="Send" ID="Button1" NAME="Button1"></div>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<div align="center">
<hr size="1">
</div>
</td>
</tr>
</col>
</col>
</table>
</div>
</form>
<!-- STEP 4: Put the content & its style (from the database) into a hidden area.
Why hidden area ? see STEP 7 --><textarea rows=7 cols=40 id="divResult" name="divResult" style="display:none">
<P><A href="
http://www.visitdenmark.com/portal/ViewProductSearchResults.srv?marketId=1%3A29%3A91f7baf8ec2dbf9d0c15&targetGroupId=1%3A83%3A91f7baf8ec2dbfb28815f&siteCategoryId=1%3A79%3A91f7baf8ec2dbfd28332c&pagePoolId=1%3A57%3A91f7baf8ec2dc0e2bb10d9&RegionId=1%3A74%3A91f7baf8ec2ddf244654f&firstProductTypeId=1%3A72%3A91f7baf8ec2ddf85dff2f&firstFacilityRowId=1%3A12%3A91f7baf8ec2e0dbd3bbaa6&secondProductTypeId=1%3A72%3A91f7baf8ec2ddf861df4e&productTypeId=1%3A72%3A91f7baf8ec2ddf861df4e&name=&templateName=SpecialSearch&advanced=true&fg_1%3A13%3A91f7baf8ec2e1bdb006ada=&v_1%3A12%3A91f7baf8ec2e1bdd136b00_1%3A106%3A91f7baf8ec2e1bdca66af7=&v_1%3A12%3A91f7baf8ec2e1bddbf6b06_1%3A106%3A91f7baf8ec2e1bdca66af7=&v_1%3A12%3A91f7baf8ec2e1be5216b0c_1%3A106%3A91f7baf8ec2e1bdca66af7=&v_1%3A12%3A91f7baf8ec2e1be6a86b12_1%3A106%3A91f7baf8ec2e1bdca66af7=&v_1%3A12%3Aac100041ecae8da56c5ac_1%3A106%3A91f7baf8ec2e1bdca66af7=&v_1%3A12%3Aac100041ecae9016df5bc_1%3A106%3A91f7baf8ec2e1bdca66af7=&v_1%3A12%3Aac100041ecae9ccc9860f_1%3A106%3A91f7baf8ec2e1bdca66af7=&v_1%3A12%3A91f7baf8ec2e1be6f66b18_1%3A106%3A91f7baf8ec2e1bdca66af7=" target=_blank>Test</A> ttt</P>
</textarea>
<textarea rows=7 cols=40 id="divProperties" name="divProperties" style="display:none">
BACKGROUND:transparent;BACKGROUND-IMAGE:;PADDING-LEFT:3px;PADDING-RIGHT:3px;PADDING-TOP:1px;PADDING-BOTTOM:3px;FONT-FAMILY:Verdana, Arial, Helvetica;FONT-SIZE:11px;COLOR:black;
</textarea></div>
</body>
</html>