Mám další problém. Pokud přidám input dynamicky, tak mi ho to nesubmitne. Zna nekdo reseni?
<table>
<form id="myform" method="POST" action="script.php">
<tr>
<td><input name="formular1"></td>
<td><input name="formular2"></td>
<!--<td><input name="formular3"></td>-->
</tr>
<input id="tlacitko" type="submit" value="odeslat_formulare">
<input id="tlacitko_pridat" type="button" value="pridat_radky">
</form>
</table>
<script>
function pridani_indexu(){
var $name_index = $("table td").length;
$("table").find("input:last").attr("name" , "formular" + $name_index);
}
$("#tlacitko_pridat").click(function(){
var radek = "<td><input></td>";
$(radek).insertAfter("td:last");
pridani_indexu();
});
</script>
<?php
$vypis = filter_input(INPUT_POST, "formular1");
echo $vypis;
$form1_w = fopen ("form1.txt" , "w");
fwrite ($form1_w, $vypis);
fclose ($form1_w);
$vypis2 = filter_input(INPUT_POST, "formular2");
echo $vypis2;
$form2_w = fopen ("form2.txt" , "w");
fwrite ($form2_w, $vypis2);
fclose ($form2_w);
$vypis3 = filter_input(INPUT_POST, "formular3");
echo $vypis3;
$form3_w = fopen ("form3.txt" , "w");
fwrite ($form3_w, $vypis3);
fclose ($form3_w);
?>