codice:
function invia(dest_url, id, titolo, livello, grammatica, abilita, testo, rivolto_a) {
$(document.createElement("form")).attr('id', 'form_upd_file').attr('action', dest_url).attr('method', 'POST').attr('style', 'display:none;').appendTo("#hidden_form");
$(document.createElement("input")).attr('name', 'ipt_action').attr('id', 'ipt_action').attr('value', 'upd_file').appendTo("#form_upd_file");
$(document.createElement("input")).attr('name', 'id').attr('id', 'id').attr('value', id).appendTo("#form_upd_file");
$(document.createElement("input")).attr('name', 'titolo').attr('id', 'titolo').attr('value', titolo).appendTo("#form_upd_file");
$(document.createElement("input")).attr('name', 'livello').attr('id', 'livello').attr('value', livello).appendTo("#form_upd_file");
$(document.createElement("input")).attr('name', 'grammatica').attr('id', 'gramatica').attr('value', grammatica).appendTo("#form_upd_file");
$(document.createElement("input")).attr('name', 'abilita').attr('id', 'abilita').attr('value', abilita).appendTo("#form_upd_file");
$(document.createElement("input")).attr('name', 'testo').attr('id', 'testo').attr('value', testo).appendTo("#form_upd_file");
$(document.createElement("input")).attr('name', 'rivolto_a').attr('id', 'rivolto_a').attr('value', rivolto_a).appendTo("#form_upd_file");
// APPENDO AL FORM HIDDEN Il campo input di tipo file
$("#my_file_upload_file_"+id).appendTo("#form_upd_file");
$("#form_upd_file").submit();
}
$("#upd_file_table input[type=submit]").click(function() {
var id = $(this).attr("id");
var titolo = $("#titolo_file_"+id).val();
var livello = $("#livello_file_"+id).val();
var grammatica = $("#grammatica_file_"+id).val();
var abilita = $("#abilita_file_"+id).val();
var testo = $("#testo_file_"+id).val();
var rivolto_a = $("#rivolto_a_file_"+id).val();
invia('', id, titolo, livello, grammatica, abilita, testo, rivolto_a);
return false;
});
Da notare che il campo input in questione scompare dalla tabella quindi viene regolarmente appeso al form "hidden" ma non arriva niente alla pagina... o meglio arrivano tutti i campi tranne quello di tipo file.... cosa devo fare? Sto impazzendo...