ocp001a ya esta solucionado pero no se si funciona en todos los navegadores en google crome si aqui el codigo completo funcionando, gracias ahora abria que mejorar las funciones que pueda realizar mas cositas.
Código HTML:
Ver original<script language="javascript">
function setHidden()
{
var frameContent=textEditor.document.body.innerHTML;
document.getElementById('titulo').value=frameContent;
}
<body onLoad="def()"><center> <div style="width:500px; text-align:left; margin-bottom:10px "> <input type="button" id="bold" style="height:21px; width:21px; font-weight:bold;" value="B" onClick="fontEdit('bold')" /> <input type="button" id="italic" style="height:21px; width:21px; font-style:italic;" value="I" onClick="fontEdit('italic')" /> <input type="button" id="underline" style="height:21px; width:21px; text-decoration:underline;" value="U" onClick="fontEdit('underline')" /> |
<input type="button" style="height:21px; width:21px;"value="L" onClick="fontEdit('justifyleft')" title="align left" /> <input type="button" style="height:21px; width:21px;"value="C" onClick="fontEdit('justifycenter')" title="center" /> <input type="button" style="height:21px; width:21px;"value="R" onClick="fontEdit('justifyright')" title="align right" /> |
<select id="fonts" onChange="fontEdit('fontname',this[this.selectedIndex].value)"> <select id="size" onChange="fontEdit('fontsize',this[this.selectedIndex].value)"> <select id="color" onChange="fontEdit('ForeColor',this[this.selectedIndex].value)"> <input type="button" style="height:21px; width:21px;"value="1" onClick="fontEdit('insertorderedlist')" title="Numbered List" /> <input type="button" style="height:21px; width:21px;"value="â—" onClick="fontEdit('insertunorderedlist')" title="Bullets List" /> <input type="button" style="height:21px; width:21px;"value="â†" onClick="fontEdit('outdent')" title="Outdent" /> <input type="button" style="height:21px; width:21px;"value="→" onClick="fontEdit('indent')" title="Indent" /> <form action="acceso3.php" method="post" onsubmit="setHidden()"> <input type="hidden" name="titulo" id="titulo" /> <input type="submit" value="submit" /> </center>
<script type="text/javascript"> <!--
function def()
{
var testframe = document.createElement("iframe");
testframe.name = testframe.id = "textEditor";
if (testframe.addEventListener){
testframe.addEventListener("load",function(e){this.contentWindow.document.designMode = "on";}, false);
} else if (testframe.attachEvent){
testframe.attachEvent("load", function(e){this.contentWindow.document.designMode = "on";});
}
document.body.appendChild(testframe);
textEditor.document.designMode="on";
textEditor.document.open();
textEditor.document.write('<head><style type="text/css">body{ font-family:arial; font-size:13px; }</style> </head>');
textEditor.document.close();
textEditor.focus();
}
function fontEdit(x,y)
{
textEditor.document.execCommand(x,"",y);
textEditor.focus();
}
-->
gracias