elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Únete al Grupo Steam elhacker.NET


+  Foro de elhacker.net
|-+  Programación
| |-+  Desarrollo Web
| | |-+  PHP (Moderador: #!drvy)
| | | |-+  Problema php -> xml
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Problema php -> xml  (Leído 1,390 veces)
qiqeroot

Desconectado Desconectado

Mensajes: 52



Ver Perfil
Problema php -> xml
« en: 17 Abril 2012, 17:41 pm »

Buenas tardes,
anteriormente generaba .xml con formularios con id fijas
pero tengo el problema de este formulario dinámico,
tengo que generar un xml a partir del siguiente código

Código:
<!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=utf-8" />

<title>Hoja de pedido</title>
<script>
var contLin = 1, tr, td, tabla;
function agregar() {

document.getElementById("OcultoContLin").value = contLin;
//var
tabla = document.getElementById('TablaMed');
tr = tabla.insertRow(tabla.rows.length);
td = tr.insertCell(tr.cells.length);
td.innerHTML = "<input type='text' size='7' name='' maxlength='7'>";
//alert (document.getElementById(td.innerHTML).id);
td = tr.insertCell(tr.cells.length);
td.innerHTML = "<input type='text' size='5' name='' maxlength='3'>";
td = tr.insertCell(tr.cells.length);
td.innerHTML = "<input type='text' size='40' name=''>";
contLin++;

}

function eliminarultima() {
    
    ultima = parseInt(document.getElementById('TablaMed').rows.length) - 1;

    if(ultima > 0){
        document.getElementById('TablaMed').deleteRow(ultima);
        contLin--;
        document.getElementById("OcultoContLin").value = contLin-1;
        }
}


</script>

<style type="text/css">
<!--
.Estilo1 {font-size: 12px}
.TEXTO { font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #FFFFFF;
}
-->
</style>
</head>

<body>
<form id="form1" name="form1" method="get" action="Untitled-6.php">
  <table align="center" width="372" border="1" id="TablaMed">
    <tr class="Estilo1">
      <td width="150">Ref</td>
      <td width="150">Cantidad</td>
      <td width="150">Observaciones</td>
    </tr>
  </table>
  <table align="center" bgcolor="#FFFFCC">
      <td>
  <p>
    <input name="AgregaMed" type="button" id="AgregaMed" value="Agregar Linea de pedido" onclick="agregar()" />
    <input name="EliminarMed" type="button" id="EliminarMed" value="Eliminar linea de pedido" onclick="eliminarultima()" />
    Lineas de Pedido:<input name="OcultoContLin" type="text" size="4" id="OcultoContLin" style="visibility:visible" />
        <input name="cadena" type="submit" id="cadena" value="Procesar pedido"/>

  </p>
  </td>
   </table>
</form>
<p>&nbsp;</p>
</body>
</html>

la estructura del xml tiene que ser referencia, cantidad, observaciones pero realmente nose como enfocarlo, mis pruebas sin resultado.

gracias por vuestra ayuda de antemano


En línea

aveces la solución es el problema
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Problema BlueZScanner y problema de conexión
Hacking Mobile
Kasswed 3 6,318 Último mensaje 6 Mayo 2006, 22:04 pm
por Gospel
Problema Css o problema con el sidebar
Desarrollo Web
gaboomsk8 6 3,579 Último mensaje 27 Diciembre 2011, 21:56 pm
por gaboomsk8
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines