Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/03/2005, 21:54
Avatar de nuevo
nuevo
 
Fecha de Ingreso: mayo-2003
Ubicación: Spain
Mensajes: 2.009
Antigüedad: 21 años, 10 meses
Puntos: 2
Pregunta Se puede hacer esto?

hola, buenas compañeros...

estoy liado con un asunto algo complicado para mi... intento mostrar en tiempo real el codigo HTML que tengo en un TEXTAEREA, en otra ventana... o frame... o como se haga, en formato HTML...

vamos a ver un ejemplo... yo tengo este textarea dentro de un formulario
Código:
<script type="text/javascript">
<!--
 function storeCaret(text) {if (text.createTextRange) {text.caretPos = document.selection.createRange().duplicate();}}
 function meter(text) {var postopic = document.PostTopic.varAdminConfigBloquesLinkCode; if (postopic.createTextRange && postopic.caretPos) { var caretPos = postopic.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;}   else postopic.value += text; postopic.focus(caretPos)}

  function codigo(accion) {
   switch(accion) {

    case "url":
     url = prompt("URL del Enlace", "http://");
     txt = prompt("TxT del Enlace", "");
     if(url) {
      url="<a href="+url+">"+txt+""+"</a>";
      meter(url);
     }
     break;

   case "form1":
   form1 = prompt("Texto", "");
    if(form1) {
      form1="<table width=\"576\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>"+form1+"</td></tr></table>";
      meter(form1);
	}
     break;

   case "form2":
   form2 = prompt("Texto", "");
   img = prompt("Imagen", "");
    if(form2) {
      form2="<table width=\"576\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><img src=\""+img+"\" height=\"32\" width=\"32\" border=\"0\"></td><td>"+form2+"</td></tr></table>";
      meter(form2);
	}
     break;

    default:
     meter(accion);
     break;
   }
  }
//-->
</script>
<!-- inicioBloque: blokeThemeEstrucPrincipalCentro -->
<form action="index.php?nucleo=adminconfigblocknewok" method="post" name="PostTopic" target="_self">
	<table class="vedit">
		<tr>
			<th colspan="2"><b>Codigo</b><br>
				<textarea name="varAdminConfigBloquesLinkCode" rows="14" cols="70" wrap="virtual"></textarea></th>
		</tr>
		<tr>
			<th colspan="2">
				<div align="center">
				    <a href="javascript:codigo('form1')"><img src="http://www.rainhosting.net/mym-studio/templates/images/formato/formato1.gif" border="0"></a>&nbsp;
				    <a href="javascript:codigo('form2')"><img src="http://www.rainhosting.net/mym-studio/templates/images/formato/formato2.gif" border="0"></a>&nbsp;
				    <a href="javascript:codigo('form3')"><img src="http://www.rainhosting.net/mym-studio/templates/images/formato/formato3.gif" border="0"></a>&nbsp;
				    <a href="javascript:codigo('form4')"><img src="http://www.rainhosting.net/mym-studio/templates/images/formato/formato4.gif" border="0"></a>&nbsp;
				    <a href="javascript:codigo('form5')"><img src="http://www.rainhosting.net/mym-studio/templates/images/formato/formato5.gif" border="0"></a>&nbsp;
				    <a href="javascript:codigo('form6')"><img src="http://www.rainhosting.net/mym-studio/templates/images/formato/formato6.gif" border="0"></a>&nbsp;
				    <a href="javascript:codigo('form7')"><img src="http://www.rainhosting.net/mym-studio/templates/images/formato/formato7.gif" border="0"></a><br>
					<input type="button" class="botones" value="Url" title="Añadir Enlace" onclick="javascript:codigo('url')">
				</div>
			</th>
		</tr>
	</table>
<br>
<input type=submit value=".: Aceptar :." class="botones">&nbsp;<input type="button" value=".: Cancelar :." onclick="history.back(-1)" class="botones">
</form>
<!-- finBloque: blokeThemeEstrucPrincipalCentro -->
lo que intento es mostrar ese codigo HTML que he metido dentro del textarea en algun frame, iframe, o scr... en modo HTML, para ver como va quedando--- mientras lo voy montando...

alguien tiene idea... o lo hizo antes.,...

gracias y salu2
__________________
3w.valenciadjs.com
3w.laislatv.com

Última edición por nuevo; 18/03/2005 a las 21:55