Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Gustav Silv

Request valor iframe (RTE Editor) para upload através de Scripting.Dic

Recommended Posts

Olá pessoal!Através do upload postado (muito bem, por sinal...) pelo amigo DarkO, consigo pegar os valores dos inputs através do UploadRequest.Item("campo").Item("Value"). Entretanto, não consigo resgatar as informações de um rich text editor, que aparentemente é um iframe. Alguém já tentou isso?Aquele abraço a todos!

Compartilhar este post


Link para o post
Compartilhar em outros sites

aparentemente é um iframe? é uma caixa de texto ou iframe? acho que você quer dizer que a caixa está dentro de um iframe e esse iframe dentro de um form. Se for isso acho que não vai ter como somente usando Asp.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olá jonathandj!

 

Segue um trecho do arquivo richtext.js onde vejo a contrução do iframe, mas antes tem a contrução de umas tabelas, etc,etc... Na citação em vermelho existe realmente um textarea, como segue:

 

}

document.writeln('<iframe id="' + rte + '" name="' + rte + '" width="' + width + 'px" height="' + height + 'px" src="' + includesPath + 'blank.htm"></iframe>');

if (!readOnly) document.writeln('<br /><input type="checkbox" id="chkSrc' + rte + '" onclick="toggleHTMLSrc(\'' + rte + '\');" /> View Source');

document.writeln('<iframe width="154" height="104" id="cp' + rte + '" src="' + includesPath + 'palette.htm" marginwidth="0" marginheight="0" scrolling="no" style="visibility:hidden; position: absolute;"></iframe>');

document.writeln('<input type="hidden" id="hdn' + rte + '" name="' + rte + '" value="">');

document.writeln('</div>');

 

document.getElementById('hdn' + rte).value = html;

enableDesignMode(rte, html, readOnly);

} else {

if (!readOnly) {

document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px;">' + html + '</textarea>');

} else {

document.writeln('<textarea name="' + rte + '" id="' + rte + '" style="width: ' + width + 'px; height: ' + height + 'px;" readonly>' + html + '</textarea>');

}

}

 

 

 

function enableDesignMode(rte, html, readOnly) {

var frameHtml = "<html id=\"" + rte + "\">\n";

frameHtml += "<head>\n";

//to reference your stylesheet, set href property below to your stylesheet path and uncomment

if (cssFile.length > 0) {

frameHtml += "<link media=\"all\" type=\"text/css\" href=\"" + cssFile + "\" rel=\"stylesheet\">\n";

} else {

frameHtml += "<style>\n";

frameHtml += "body {\n";

frameHtml += " background: #FFFFFF;\n";

frameHtml += " margin: 0px;\n";

frameHtml += " padding: 0px;\n";

frameHtml += "}\n";

frameHtml += "</style>\n";

}

frameHtml += "</head>\n";

frameHtml += "<body>\n";

frameHtml += html + "\n";

frameHtml += "</body>\n";

frameHtml += "</html>";

 

if (document.all) {

var oRTE = frames[rte].document;

oRTE.open();

oRTE.write(frameHtml);

oRTE.close();

if (!readOnly) oRTE.designMode = "On";

} else {

try {

if (!readOnly) document.getElementById(rte).contentDocument.designMode = "on";

try {

var oRTE = document.getElementById(rte).contentWindow.document;

oRTE.open();

oRTE.write(frameHtml);

oRTE.close();

if (isGecko && !readOnly) {

//attach a keyboard handler for gecko browsers to make keyboard shortcuts work

oRTE.addEventListener("keypress", kb_handler, true);

}

} catch (e) {

alert("Error preloading content.");

}

} catch (e) {

//gecko may take some time to enable design mode.

//Keep looping until able to set.

if (isGecko) {

setTimeout("enableDesignMode('" + rte + "', '" + html + "', " + readOnly + ");", 10);

} else {

return false;

}

}

}

}

 

Se coloco simplesmente um textarea igual este do forum, funciona perfeitamente. Mas com o rich text (link do desenvolvedor: http://www.kevinroth.com/rte/demo.htm. Link para download: http://www.dynamicdrive.com/dynamicindex16...itor/index.htm), não consigo de forma alguma. Até mesmo tentando submeter 2 formularios simultaneos, não consegui.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.