473,513 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

editor features?

I want to use a simple editor which has the capability of changing color or
bold it... a very simple one in my application of asp/access. Can anyone
suggest any such editor whereby I can use it?
my purpose is to get story written by a student in the textbox/textarea of
that editor from the database. The teacher highlights using the editor
features....making letters bold or in red to highlight changes. and then
save it to the database.

later available for the student to view his changes.

any help would be appreciable.
thanks
Jul 19 '05 #1
4 2129
"monika" <mo********@hotmail.com> wrote in message
news:uB**************@TK2MSFTNGP09.phx.gbl...
I want to use a simple editor which has the capability of changing color
or bold it... a very simple one in my application of asp/access. Can
anyone suggest any such editor whereby I can use it?


Have you tried the RichTextBox control ?
Loading/Saving the TextRTF property from/to the database should
do the trick...

HTH,
Phill W.
Jul 19 '05 #2
Try cutting and pasting the following....it'll get you started....

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD>

<SCRIPT language=javascript id=clientEventHandlersJS>
<!--

var cursorPos;

function saveCursorPos(){
cursorPos=document.selection.createRange().duplica te();
//alert('cursorPos='+ cursorPos.value );

}

function cmdBullet_onclick()
{

divDisplay.document.execCommand('insertunorderedli st','','');
divDisplay.focus();
return false;

}

function cmdSave_onclick() {

//hiddenInput.value=divDisplay.innerHTML;
theForm.hiddenInput.value=divDisplay.innerHTML;
//theForm.hiddenProcInput.value=divProc.innerHTML;

if (theForm.hiddenInput.value.length >102399)
{
alert('Document is too big:' + theForm.hiddenInput.value.length);
return false;

}
if (theForm.Category.selectedIndex==0)
{
alert('Please select/create a Category');
return false;
}
if (theForm.Code.value.length==0)
{
alert('Please enter a Policy Number');
return false;
}
if (theForm.Title.value.length==0)
{
alert('Please enter a Policy Title');
return false;

}
if (theForm.hiddenInput.value.length==0)
{
alert('Please enter the Policy Content.');
return false;
}

theForm.submit();
}

function cmdNumbered_onclick() {
divDisplay.document.execCommand('insertorderedlist ','','');
divDisplay.focus();
return false;
}

function cmdBold_onclick() {

divDisplay.document.execCommand('bold','','');
divDisplay.focus();
return false;

}

function cmdItalic_onclick() {
divDisplay.document.execCommand('italic','','');
divDisplay.focus();
return false;
}

function cmdTab_onclick() {
divDisplay.document.execCommand('indent','','');
divDisplay.focus();
return false;
}

function cmdUnTab_onclick() {
divDisplay.document.execCommand('outdent','','');
divDisplay.focus();
return false;
}

//-->
</SCRIPT>

</HEAD>
<BODY>
<DIV id=Layer1
style="Z-INDEX: 3; LEFT: 631px; WIDTH: 96px; POSITION: absolute; TOP:
9px; HEIGHT: 42px">
<DIV align=right><A href="http://tbserver/CCAC_V_1_0/"><IMG
src="Editor_files/close_spacer.gif" border=0></A></DIV></DIV>
<DIV id=overDiv
style="Z-INDEX: 1; LEFT: 300px; POSITION: absolute; TOP: 200px"></DIV>
<SCRIPT language=JavaScript src="Editor_files/overlib.js"></SCRIPT>

<H2 align=center><IMG height=50
src="Editor_files/add_new_policy_header2.gif" width=600></H2>
<FORM name=theForm action=SaveNew.asp method=post>

<TABLE width=500>
<TBODY>
<TR>
<TD>
<FIELDSET><LEGEND><FONT size=2>Policy Content </FONT></LEGEND>
<TABLE>
<TBODY>
<TR>
<TH colSpan=3>
<DIV align=center>
<TABLE cellSpacing=0 cellPadding=0 align=center>
<TBODY>
<TR>
<TD id=Bold width=31><INPUT language=javascript
id=cmdBold onclick="return cmdBold_onclick()"
type=image
src="Editor_files/Bold.gif" value=Bold name=image>
</TD>
<TD id=Italic width=31><INPUT language=javascript
id=cmdItalic onclick="return cmdItalic_onclick()"
type=image src="Editor_files/Italic.gif"
value=Italic
name=image> </TD>
<TD id=Bullet width=31><INPUT language=javascript
id=cmdBullet onclick="return cmdBullet_onclick()"
type=image src="Editor_files/Bullet.gif"
value=Bullet
name=cmdBullet> </TD>
<TD id=Numbered width=31><INPUT language=javascript
id=cmdNumbered onclick="return
cmdNumbered_onclick()"
type=image src="Editor_files/Numbered.gif"
value=Numbered name=image> </TD>
<TD id=Tab width=31><INPUT language=javascript
id=cmdTab
onclick="return cmdTab_onclick()" type=image
src="Editor_files/tab.gif" value=Tab name=image>
</TD>
<TD id=UnTab width=31><INPUT language=javascript
id=cmdUnTab onclick="return cmdUnTab_onclick()"
type=image src="Editor_files/Untab.gif" value=UnTab
name=image> </TD>
<TD id=UnTab width=311>
<DIV align=right><IMG height=30
src="Editor_files/add_policy_content.gif"

width=200></DIV></TD></TR></TBODY></TABLE></DIV></TH></TR>
<TR>
<TD colSpan=3><INPUT style="WIDTH: 207px; HEIGHT: 22px"
type=hidden size=26 name=hiddenInput>
<TABLE onclick=divDisplay.focus(); borderColor=#9ea1d6
height=100 cellSpacing=0 cellPadding=0 width=502
align=center
bgColor=#e5e6f3 border=1>
<TBODY>
<TR border="0">
<TD vAlign=top width=500 border="0">
<DIV id=divDisplay onkeyup=saveCursorPos();
contentEditable=true

name="divDisplay"></DIV></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD align=right colSpan=3><INPUT onclick=cmdSave_onclick();
type=button

value="Next>>>"></TD></TR></TBODY></TABLE></FIELDSET>
</TD></TR></TBODY></TABLE></FORM>
</BODY></HTML>
"monika" <mo********@hotmail.com> wrote in message
news:uB**************@TK2MSFTNGP09.phx.gbl...
I want to use a simple editor which has the capability of changing color or bold it... a very simple one in my application of asp/access. Can anyone
suggest any such editor whereby I can use it?
my purpose is to get story written by a student in the textbox/textarea of
that editor from the database. The teacher highlights using the editor
features....making letters bold or in red to highlight changes. and then
save it to the database.

later available for the student to view his changes.

any help would be appreciable.
thanks

Jul 19 '05 #3
hi tom ..thanks for the quick response. I realise that here divDisplay is
the object where i need to retrieve the value from the database. pls see the
change i did to make it useful for my application:
..
..
..
..
<%
DIM RSA
DIM QUERY

Set RSA = Server.CreateObject("ADODB.Recordset")
QUERY = "select story_name from story_table where story_id = 1"
rsa.open query, "dsn=school"
%>
<TR>
<TD colSpan=3><INPUT style="WIDTH: 207px; HEIGHT: 22px"
type=hidden size=26 name=hiddenInput>
<TABLE onclick=divDisplay.focus(); borderColor=#9ea1d6
height=100 cellSpacing=0 cellPadding=0 width=502
align=center bgColor=#e5e6f3 border=1
value=<%=rsa.fields("story_name")%>>
...remaining code...

but i dont the value being retrieved from the database? how can that be
achieved?
my purpose is to get the story from the database in the editable textbox or
whatever and then save the content to the database after changing it?

would be a great help if u respond.
thanks

"Tom B" <sh*****@hotmail.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Try cutting and pasting the following....it'll get you started....

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD>

<SCRIPT language=javascript id=clientEventHandlersJS>
<!--

var cursorPos;

function saveCursorPos(){
cursorPos=document.selection.createRange().duplica te();
//alert('cursorPos='+ cursorPos.value );

}

function cmdBullet_onclick()
{

divDisplay.document.execCommand('insertunorderedli st','','');
divDisplay.focus();
return false;

}

function cmdSave_onclick() {

//hiddenInput.value=divDisplay.innerHTML;
theForm.hiddenInput.value=divDisplay.innerHTML;
//theForm.hiddenProcInput.value=divProc.innerHTML;

if (theForm.hiddenInput.value.length >102399)
{
alert('Document is too big:' + theForm.hiddenInput.value.length);
return false;

}
if (theForm.Category.selectedIndex==0)
{
alert('Please select/create a Category');
return false;
}
if (theForm.Code.value.length==0)
{
alert('Please enter a Policy Number');
return false;
}
if (theForm.Title.value.length==0)
{
alert('Please enter a Policy Title');
return false;

}
if (theForm.hiddenInput.value.length==0)
{
alert('Please enter the Policy Content.');
return false;
}

theForm.submit();
}

function cmdNumbered_onclick() {
divDisplay.document.execCommand('insertorderedlist ','','');
divDisplay.focus();
return false;
}

function cmdBold_onclick() {

divDisplay.document.execCommand('bold','','');
divDisplay.focus();
return false;

}

function cmdItalic_onclick() {
divDisplay.document.execCommand('italic','','');
divDisplay.focus();
return false;
}

function cmdTab_onclick() {
divDisplay.document.execCommand('indent','','');
divDisplay.focus();
return false;
}

function cmdUnTab_onclick() {
divDisplay.document.execCommand('outdent','','');
divDisplay.focus();
return false;
}

//-->
</SCRIPT>

</HEAD>
<BODY>
<DIV id=Layer1
style="Z-INDEX: 3; LEFT: 631px; WIDTH: 96px; POSITION: absolute; TOP: 9px; HEIGHT: 42px">
<DIV align=right><A href="http://tbserver/CCAC_V_1_0/"><IMG
src="Editor_files/close_spacer.gif" border=0></A></DIV></DIV>
<DIV id=overDiv
style="Z-INDEX: 1; LEFT: 300px; POSITION: absolute; TOP: 200px"></DIV> <SCRIPT language=JavaScript src="Editor_files/overlib.js"></SCRIPT>

<H2 align=center><IMG height=50
src="Editor_files/add_new_policy_header2.gif" width=600></H2>
<FORM name=theForm action=SaveNew.asp method=post>

<TABLE width=500>
<TBODY>
<TR>
<TD>
<FIELDSET><LEGEND><FONT size=2>Policy Content </FONT></LEGEND>
<TABLE>
<TBODY>
<TR>
<TH colSpan=3>
<DIV align=center>
<TABLE cellSpacing=0 cellPadding=0 align=center>
<TBODY>
<TR>
<TD id=Bold width=31><INPUT language=javascript
id=cmdBold onclick="return cmdBold_onclick()"
type=image
src="Editor_files/Bold.gif" value=Bold name=image>
</TD>
<TD id=Italic width=31><INPUT language=javascript
id=cmdItalic onclick="return cmdItalic_onclick()"
type=image src="Editor_files/Italic.gif"
value=Italic
name=image> </TD>
<TD id=Bullet width=31><INPUT language=javascript
id=cmdBullet onclick="return cmdBullet_onclick()"
type=image src="Editor_files/Bullet.gif"
value=Bullet
name=cmdBullet> </TD>
<TD id=Numbered width=31><INPUT language=javascript
id=cmdNumbered onclick="return
cmdNumbered_onclick()"
type=image src="Editor_files/Numbered.gif"
value=Numbered name=image> </TD>
<TD id=Tab width=31><INPUT language=javascript
id=cmdTab
onclick="return cmdTab_onclick()" type=image
src="Editor_files/tab.gif" value=Tab name=image>
</TD>
<TD id=UnTab width=31><INPUT language=javascript
id=cmdUnTab onclick="return cmdUnTab_onclick()"
type=image src="Editor_files/Untab.gif" value=UnTab name=image> </TD>
<TD id=UnTab width=311>
<DIV align=right><IMG height=30
src="Editor_files/add_policy_content.gif"

width=200></DIV></TD></TR></TBODY></TABLE></DIV></TH></TR>
<TR>
<TD colSpan=3><INPUT style="WIDTH: 207px; HEIGHT: 22px"
type=hidden size=26 name=hiddenInput>
<TABLE onclick=divDisplay.focus(); borderColor=#9ea1d6
height=100 cellSpacing=0 cellPadding=0 width=502
align=center
bgColor=#e5e6f3 border=1>
<TBODY>
<TR border="0">
<TD vAlign=top width=500 border="0">
<DIV id=divDisplay onkeyup=saveCursorPos();
contentEditable=true

name="divDisplay"></DIV></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD align=right colSpan=3><INPUT onclick=cmdSave_onclick(); type=button

value="Next>>>"></TD></TR></TBODY></TABLE></FIELDSET>
</TD></TR></TBODY></TABLE></FORM>
</BODY></HTML>
"monika" <mo********@hotmail.com> wrote in message
news:uB**************@TK2MSFTNGP09.phx.gbl...
I want to use a simple editor which has the capability of changing color

or
bold it... a very simple one in my application of asp/access. Can anyone
suggest any such editor whereby I can use it?
my purpose is to get story written by a student in the textbox/textarea of that editor from the database. The teacher highlights using the editor
features....making letters bold or in red to highlight changes. and then
save it to the database.

later available for the student to view his changes.

any help would be appreciable.
thanks


Jul 19 '05 #4
Don't use value= as that's for an input box and this is a div within a table
cell

<DIV id=divDisplay onkeyup=saveCursorPos();
contentEditable=true
name="divDisplay"><%=rsa.fields("story_name")%></DIV>

You'll note that there is a hidden form field with the clever name
"hiddenInput" (don't ask why there are size values....my graphics guy)
when the Save button is clicked, the data with in the div is put into the
hidden field through the cmdSave_onClick function.

I just realized this really has nothing to do with asp and is all
client-side stuff. Feel free to respond to me directly, or post in a
javascript group.

Tom B

"monika" <mo********@hotmail.com> wrote in message
news:uV**************@TK2MSFTNGP11.phx.gbl...
hi tom ..thanks for the quick response. I realise that here divDisplay is
the object where i need to retrieve the value from the database. pls see the change i did to make it useful for my application:
.
.
.
.
<%
DIM RSA
DIM QUERY

Set RSA = Server.CreateObject("ADODB.Recordset")
QUERY = "select story_name from story_table where story_id = 1"
rsa.open query, "dsn=school"
%>
<TR>
<TD colSpan=3><INPUT style="WIDTH: 207px; HEIGHT: 22px"
type=hidden size=26 name=hiddenInput>
<TABLE onclick=divDisplay.focus(); borderColor=#9ea1d6
height=100 cellSpacing=0 cellPadding=0 width=502
align=center bgColor=#e5e6f3 border=1
value=<%=rsa.fields("story_name")%>>
..remaining code...

but i dont the value being retrieved from the database? how can that be
achieved?
my purpose is to get the story from the database in the editable textbox or whatever and then save the content to the database after changing it?

would be a great help if u respond.
thanks

"Tom B" <sh*****@hotmail.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Try cutting and pasting the following....it'll get you started....

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD>

<SCRIPT language=javascript id=clientEventHandlersJS>
<!--

var cursorPos;

function saveCursorPos(){
cursorPos=document.selection.createRange().duplica te();
//alert('cursorPos='+ cursorPos.value );

}

function cmdBullet_onclick()
{

divDisplay.document.execCommand('insertunorderedli st','','');
divDisplay.focus();
return false;

}

function cmdSave_onclick() {

//hiddenInput.value=divDisplay.innerHTML;
theForm.hiddenInput.value=divDisplay.innerHTML;
//theForm.hiddenProcInput.value=divProc.innerHTML;

if (theForm.hiddenInput.value.length >102399)
{
alert('Document is too big:' + theForm.hiddenInput.value.length);
return false;

}
if (theForm.Category.selectedIndex==0)
{
alert('Please select/create a Category');
return false;
}
if (theForm.Code.value.length==0)
{
alert('Please enter a Policy Number');
return false;
}
if (theForm.Title.value.length==0)
{
alert('Please enter a Policy Title');
return false;

}
if (theForm.hiddenInput.value.length==0)
{
alert('Please enter the Policy Content.');
return false;
}

theForm.submit();
}

function cmdNumbered_onclick() {
divDisplay.document.execCommand('insertorderedlist ','','');
divDisplay.focus();
return false;
}

function cmdBold_onclick() {

divDisplay.document.execCommand('bold','','');
divDisplay.focus();
return false;

}

function cmdItalic_onclick() {
divDisplay.document.execCommand('italic','','');
divDisplay.focus();
return false;
}

function cmdTab_onclick() {
divDisplay.document.execCommand('indent','','');
divDisplay.focus();
return false;
}

function cmdUnTab_onclick() {
divDisplay.document.execCommand('outdent','','');
divDisplay.focus();
return false;
}

//-->
</SCRIPT>

</HEAD>
<BODY>
<DIV id=Layer1
style="Z-INDEX: 3; LEFT: 631px; WIDTH: 96px; POSITION: absolute; TOP:
9px; HEIGHT: 42px">
<DIV align=right><A href="http://tbserver/CCAC_V_1_0/"><IMG
src="Editor_files/close_spacer.gif" border=0></A></DIV></DIV>
<DIV id=overDiv
style="Z-INDEX: 1; LEFT: 300px; POSITION: absolute; TOP:

200px"></DIV>
<SCRIPT language=JavaScript src="Editor_files/overlib.js"></SCRIPT>

<H2 align=center><IMG height=50
src="Editor_files/add_new_policy_header2.gif" width=600></H2>
<FORM name=theForm action=SaveNew.asp method=post>

<TABLE width=500>
<TBODY>
<TR>
<TD>
<FIELDSET><LEGEND><FONT size=2>Policy Content </FONT></LEGEND> <TABLE>
<TBODY>
<TR>
<TH colSpan=3>
<DIV align=center>
<TABLE cellSpacing=0 cellPadding=0 align=center>
<TBODY>
<TR>
<TD id=Bold width=31><INPUT language=javascript
id=cmdBold onclick="return cmdBold_onclick()"
type=image
src="Editor_files/Bold.gif" value=Bold name=image> </TD>
<TD id=Italic width=31><INPUT language=javascript
id=cmdItalic onclick="return cmdItalic_onclick()" type=image src="Editor_files/Italic.gif"
value=Italic
name=image> </TD>
<TD id=Bullet width=31><INPUT language=javascript
id=cmdBullet onclick="return cmdBullet_onclick()" type=image src="Editor_files/Bullet.gif"
value=Bullet
name=cmdBullet> </TD>
<TD id=Numbered width=31><INPUT language=javascript id=cmdNumbered onclick="return
cmdNumbered_onclick()"
type=image src="Editor_files/Numbered.gif"
value=Numbered name=image> </TD>
<TD id=Tab width=31><INPUT language=javascript
id=cmdTab
onclick="return cmdTab_onclick()" type=image
src="Editor_files/tab.gif" value=Tab name=image>
</TD>
<TD id=UnTab width=31><INPUT language=javascript
id=cmdUnTab onclick="return cmdUnTab_onclick()"
type=image src="Editor_files/Untab.gif"

value=UnTab
name=image> </TD>
<TD id=UnTab width=311>
<DIV align=right><IMG height=30
src="Editor_files/add_policy_content.gif"

width=200></DIV></TD></TR></TBODY></TABLE></DIV></TH></TR>
<TR>
<TD colSpan=3><INPUT style="WIDTH: 207px; HEIGHT: 22px"
type=hidden size=26 name=hiddenInput>
<TABLE onclick=divDisplay.focus(); borderColor=#9ea1d6
height=100 cellSpacing=0 cellPadding=0 width=502
align=center
bgColor=#e5e6f3 border=1>
<TBODY>
<TR border="0">
<TD vAlign=top width=500 border="0">
<DIV id=divDisplay onkeyup=saveCursorPos();
contentEditable=true

name="divDisplay"></DIV></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD align=right colSpan=3><INPUT

onclick=cmdSave_onclick();
type=button

value="Next>>>"></TD></TR></TBODY></TABLE></FIELDSET>
</TD></TR></TBODY></TABLE></FORM>
</BODY></HTML>
"monika" <mo********@hotmail.com> wrote in message
news:uB**************@TK2MSFTNGP09.phx.gbl...
I want to use a simple editor which has the capability of changing color
or
bold it... a very simple one in my application of asp/access. Can

anyone suggest any such editor whereby I can use it?
my purpose is to get story written by a student in the textbox/textarea of that editor from the database. The teacher highlights using the editor
features....making letters bold or in red to highlight changes. and

then save it to the database.

later available for the student to view his changes.

any help would be appreciable.
thanks



Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2981
by: Chris Cioffi | last post by:
I started writing this list because I wanted to have definite points to base a comparison on and as the starting point of writing something myself. After looking around, I think it would be a...
7
4363
by: Mike Kamermans | last post by:
I hope someone can help me, because what I'm going through at the moment trying to edit XML documents is enough to make me want to never edit XML again. I'm looking for an XML editor that has a...
0
1367
by: kiyut | last post by:
We proudly released Sketsa SVG Graphics Editor 2.1. Sketsa is a cross platform vector drawing application based on SVG. It features various tools for optimizing content creation, giving designers...
15
2123
by: JC Home | last post by:
Hi all, I am just learning JavaScript and would love to find a good editor that helps with syntax and debugging. Any suggestions? Thanks!! -- Jeff Ciaccio Dallas, GA
0
2143
by: 356523600 | last post by:
HTML To PHP Converter 4.2.1.8 Free download Get more for less ... HTML To PHP Converter 4.2.1.8 Get more for less! With a new version of HTML To PHP Converter 4, we've dropped the price and given...
0
7267
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7175
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7542
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4754
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3247
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1609
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
466
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.