Ver Mensaje Individual
  #3 (permalink)  
Antiguo 22/03/2008, 10:11
El-FeNiX
 
Fecha de Ingreso: enero-2008
Mensajes: 381
Antigüedad: 17 años
Puntos: 19
Re: Problema con formularios dinamicos

derkenuke, muchas gracias ya he podido solucionar el problema

no he contestado antes porque hasta ahora no he conjseguido hacerlo funcionar, he tenido que modificar algunas cosas mas

Aqui dejo el codigo con las modificaciones que he echo para que funcione por si a alguien le interesa

Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Documento sin t&iacute;tulo</title>
<script language="javascript" type="text/javascript">
	
	function add(){
		NewRow = document.getElementById("Form").insertRow(5);
		NewRow.id=5;
		NewCell=NewRow.insertCell(-1);
		NewCell.innerHTML="<b>Especificar Genero</b>";
		NewCell=NewRow.insertCell(-1);
		NewCell.innerHTML="<input type=\"text\" name=\"Genero\" size=\"40\" maxlength=\"100\">";
	}
	 
	function remove(){
		var oTr = NewRow;
		while(oTr.nodeName.toLowerCase()!='tr') {
			oTr=oTr.parentNode;
		}
		var root = oTr.parentNode;
		root.removeChild(oTr);
	}
	
	function check(value) {
		if (value == 0) { 
			added = "yes";
			add();
		}
		else {
			if(added=="yes") remove();
		}
	}
	
</script>
</head>

<body>
<form method="post" action="modules.php?name=$module_name&amp;par=AddingFilm">
<table width="100%" border="0" cellspacing="3" id="Form">
<tr><td nowrap><b>Titulo</b></td><td><input type="text" name="title" size="40" maxlength="100"></td></tr>
<tr><td nowrap><b>Imagen</b></td><td><input type="file" name="imagen" size="40" maxlength="255"></td></tr>
<tr><td nowrap><b>Link de descarga</b></td><td><input type="text" name="down_link" size="40" maxlength="255"></td></tr>
<tr><td nowrap><b>Codigo para ver Online</b></td><td><input type="text" name="online_link" size="40" maxlength="255"></td></tr>
<tr><td nowrap><b>Genero</b></td><td><select name="genre" onChange="check(this.value)"><option value="13">Acción</option><option value="14">Animación</option><option value="15">Aventuras</option><option value="26">Comedia</option><option value="20">Drama</option><option value="24">Ficcion</option><option value="25">Historico</option><option value="22">Policiaca</option><option value="23">Suspense</option><option value="21">Terror</option><option value="0">Otro</option></select></td></tr>
<tr><td nowrap><b>Subgenero</b></td><td><input type="text" name="subgenre" size="40" maxlength="100"></td></tr>
<tr><td nowrap><b>Fecha de estreno</b></td><td><input type="text" name="day" size="2" maxlength="2">
											   <input type="text" name="month" size="2" maxlength="2">
                                               <input type="text" name="year" size="4" maxlength="4">&nbsp;(dia/mes/a&ntilde;o)</td></tr>
<tr><td nowrap><b>Duracion</b></td><td><input type="text" name="duracion" size="40" maxlength="50"></td></tr>
<tr><td nowrap><b>Link de informacion</b></td><td><input type="text" name="infolink" size="40" maxlength="255"></td></tr>
<tr><td nowrap><b>Otra Informacion</b></td><td><input type="text" name="otherinfo" size="40" maxlength="255"></td></tr>
<tr><td nowrap><b>Sinopsis</b></td><td><textarea name="sinopsis" cols="60" rows="10"></textarea></td></tr>
<tr><td nowrap><b>Estrellas</b></td><td><input type="text" name="starts" size="40" maxlength="255"></td></tr>
<tr><td>&nbsp;</td><td><input type="submit" name="submit" value="Agregar"></td></tr>
</table></form>
</body>
</html> 
Saludos