Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/08/2005, 13:55
Avatar de MaBoRaK
MaBoRaK
 
Fecha de Ingreso: abril-2003
Ubicación: La Paz - Bolivia
Mensajes: 2.003
Antigüedad: 21 años
Puntos: 35
loading...........


Los nombres deben ser un ARRAY

Código PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd"
>
<
html>
<
head>
    <
title>Free beer signup form</title>

    <
script type="text/javascript">
    
// var fieldCount = 1;
     
function addFriend() {
  
//      fieldCount++;
        
var newFriend document.createElement('input');
        
newFriend.type 'text';
        
newFriend.name 'friends[]';
//        newFriend.id = 'friend' + fieldCount;
        
document.getElementById('fs').appendChild(newFrien  d);
     }
    
</script>

    <style type="text/css">
     input {
        display: block;
        margin-bottom: 2px;
     }
     button {
        float: right;
     }
     fieldset {
        border: 1px solid black;
     }
    </style>

</head>
<body>
    <h1>Free beer signup form</h1>
    <form>
     <label for="you">Your name</label>
     <input type="text" name="you" id="you">
     <fieldset id="fs">
        <legend>Friends you wish to invite</legend>
        <button onclick="addFriend(); return false;">
         Add another friend
        </button>
        <input type="text" name="friends[]" id="friend1">
     </fieldset>
     <input type="submit" value="Save details">
    </form>
</body>
</html> 
De esta forma los campos que genera seran el mismo array y ahi pones datos etc etc y en tu SERVIDOR lo procesas como datos de un array.

Si no puedes lo de procesar en el servidor avisa, o que es lo que quieres hacer.

PD: he comentado el codigo innecesario


connection closed.
__________________

Maborak Technologies