Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/11/2014, 15:11
Anarko
 
Fecha de Ingreso: febrero-2004
Mensajes: 1.987
Antigüedad: 20 años, 3 meses
Puntos: 22
¿cómo envío el contenido de un formulario? (method="post" action="file.php")

Hola.

De aquí:
http://www.forosdelweb.com/2462878-post270.html
Tomé el código y le elimine algunas líneas (solo necesito poder insertar imagenes).

Vá de maravilla, pero debido a que no entiendo ése código, no sé cómo pasar el contenido INSERTADO por medio del método POST al programa "file.php"

Álguien me ayuda por favor?


El código es éste:
Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<style>
input{
border:1px solid #000;
background:#CCCCCC;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:9px;
margin-bottom:3px;
}
</style>
<script>
var editor;
function $(id){
    return document.getElementById(id);
}
function insertarImagen(){
    var u;
    if(!(u=prompt('ingresar url','http://')))return;
    editor.execCommand("InsertImage",false,u);
}
function inHTML(){
    var u,u2;
    if(!(u=prompt('ingresar html')))return;
        try{
            editor.execCommand("inserthtml",false,u);
        }catch(e){
            try{
                u2=editor.selection.createRange();
                u2.pasteHTML(u);
            }catch(E){
                alert('nop');
            }
        }
}
function htmlOEditor(e){
e=e || window.event;
ob=e.target || e.srcElement
$('edit').style.display=(ob.value=='html')?'none':'block';
$('ht').style.display=(ob.value!='html')?'none':'block';
$('ht').innerHTML=rev(editor.body.innerHTML);
ob.value=(ob.value=='html')?'editor':'html';
}
window.onload=function(){  
    editor=$('edit').contentDocument || $('edit').contentWindow.document;
    editor.designMode='on';
}
</script>
</head>

<body><form id="form1" name="form1" method="post" action="file.php" target="_blank"><input type="button" name="Submit6" value="imagen" onclick="insertarImagen()" /><iframe id="edit" width="100%" height="300" style=" border:1px solid #000;"></iframe><div id="ht" style="width:100%;height:300px; overflow:auto;border:1px solid #000;display:none;"></div>
<div style="margin-top:3px;"><input name="ver" type="button" id="ver" onclick="htmlOEditor(event);" value="html" /> <input type="submit" /></div></form></body></html> 
...cómo envío la info de ése formulario?

Pues siempre que le doy "Enviar" llega vacío. :(


Gracias!