problemas com editor HTML
Ola, Boa Tarde , estou com um problemas para resgatar o texto editado pelo meu Editor HTML.
Quando eu dou o sumbit ele resgata todos os campos MENOS o iframe que esta editando o meu texto, alguem sabe porque?
Editor
<script language="JavaScript">
function iniciar() {
editor.document.designMode = 'On';
document.forms["form"].onsubmit=function(){
document.getElementById("texto").value=editor.document.body.innerHTML
return true;
}
}
function negrito() {
editor.document.execCommand('bold', false, null);
}
function vermelho() {
editor.document.execCommand("forecolor",false,"#b92a30");
}
function vermelho_normal() {
editor.document.execCommand("forecolor",false,"#333333");
}
</script>
iframe que mostra o editor:
<body onLoad="Iniciar()" bgcolor="#EFEDE1">
<table width="553" border="0" cellpadding="0" cellspacing="2">
<form action="" method="post" name="form" onSubmit="return Novo();">
<tr>
<td align="center">
<!-- Negrito -->
<img src="../img/b_normal.jpg" onClick="negrito()" style="cursor:hand" >
<!-- negro -->
<img src="../img/a_vermelho.jpg" onClick="vermelho()" style="cursor:hand">
<!-- vermelho -->
<img src="../img/a_preto.jpg" onClick="vermelho_normal()" style="cursor:hand">
</td>
</tr>
<iframe id="editor" frameborder="0" name="editor"
style="border:1px solid #CCCCCC; width: 525px; height:250px">
</iframe>
<tr>
<td><input name="button" type="submit" class="formulario" id="button" value="Adicionar" /></td>
</tr>
</form>
</table>
Campo hidden para resgatar o que foi digitado no iframe
<input type="hidden" id="texto" name="texto" >
O problema é que nao resgato absolutamente NADA desse campo hidden, meu formulario tem 3 input types mais esse iframe com o editor de texto e ele só nao resgata o conteudo desse iframe, alguem sabe porque?
Obrigada
Veronica
Discussão (1)
Carregando comentários...