Gracias por tu respuesta, lo he estado intentando como me has sugerido, pero, o estoy haciendo algo mal, o no se..., mira, te pongo como quedaria el codigo que supuestamente deberia de funcionar:
Código HTML:
Ver original <form id="demoForm" method="post" action="json.html">
<span class="step" id="first"> <span class="font_normal_07em_black">Insertar discos
</span><br /> <input class="input_field_12em" name="nombreDisco" id="nonmbreDisco"><br /> <input class="input_field_12em" name="discografica" id="discografica"><br /> <input class="input_field_12em" name="genero" id="genero"><br /> <label for="anioSalida">Año de salida (aaaa-mm-dd)
</label><br /> <input class="input_field_12em" name="anioSalida" id="anioSalida"><br /> <input class="input_field_12em" name="file" id="file" type='file'><br /> <label for="num_canciones">Numero de canciones
</label><br /> <input class="input_field_12em" name="numCanciones" id="numCanciones" onChange="canciones();"><br />
<span id="confirmation" class="step">
<div id="demoNavigation"> <input class="navigation_button" value="Back" type="reset"> <input class="navigation_button" value="Next" type="submit" >
<script type="text/javascript" src="./js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="./js/jquery.history.js"></script> <script type="text/javascript" src="./js/jquery.form.js"></script> <script type="text/javascript" src="./js/jquery.validate.js"></script> <script type="text/javascript" src="./js/jquery.form.wizard-2.0.1-min.js"></script> <script type="text/javascript"> $(function(){
$("#demoForm").formwizard({ //wizard settings
formPluginEnabled: true, //Ajax is used to post the form to the server
validationEnabled : true, //The Validation plugin is used for validating the form at each step
focusFirstInput : true // puts focus at the first input on each step
},
{
//validation settings
messages: { email: "Invalid email (custom message)"} // custom message shown when the email is invalid
},
{
// form plugin settings
success: function(data){ // called when the form has been submitted correctly to the server
$("#status").fadeTo(500,1,function(){ $(this).html("You are now registered!").fadeTo(5000, 0); })
},
beforeSubmit: function(data){ // called just before the form is submitted
$("#data").html("Data sent to the server :
<br />" + $.param(data));
},
dataType: 'json',
resetForm: true
}
);
});
<script language="javascript" type="text/javascript">
function canciones(){
var numCanciones = document.demoForm.numCanciones.value;
var div=document.getElementById("canciones");
for (i=0; i<= numCanciones; i++){
div.innerHTML=div.innerHTML+'<label for="titulo">Titulo
</label><br /> <input name="tituloCancion" class="input_field_25em" id="tituloCanciones" size="20"> <input class="input_field_35em" name="duracion" id="duracion"><br />'
}
}