
o ile button przeskakuje na "Anuluj" - to nie wraca i poza tym nic sie nie dzieje:
<?php if ($countCats < 1) { echo "<button class=\"btn btn-md text-center btn-submit\" type=\"submit\" name=\"addcat\"><b>Dodaj katalog</b></button>"; } else { for ($i = 0; $i < $countCats; $i++) { $lp = $i+1; echo " <div class=\"row\"> <div class=\"col-sm-1\"> <div class=\"form-group\"> <label>Lp</label> <input class=\"form-control text-center\" type=\"text\" name=\"lp\" value=\"".$lp."\" disabled /> </div> </div> <div class=\"col-sm-4\"> <div class=\"form-group\"> <label>Tytuł katalogu</label> <input class=\"form-control text-center\" type=\"text\" name=\"newCatalogTitle".$i."\" value=\"".$catalog[$i] -> title."\" required /> </div> </div> <div class=\"col-sm-2\"> <div class=\"form-group\"> <label>Plik katalogu</label> <input class=\"form-control text-center\" type=\"text\" id=\"newCatalogFile".$i."\" name=\"newCatalogFile".$i."\" value=\"".$catalog[$i] -> file."\" required disabled /> </div> </div> <div class=\"col-sm-1\"> <div class=\"form-group\"> <label></label> <button class=\"btn btn-md text-center btn-back\" type=\"button\" id=\"changeCatFile".$i."\" name=\"changeCatFile".$i."\" onclick=\"changeFile();\">Zmień plik</button> </div> </div> </div> "; echo " <script> function changeFile(){ $(document).ready(function(){ if ($('#newCatalogFile".$i."').prop('type: text')){ $('#changeCatFile".$i."').html('Zmień plik'); $('#newCatalogFile".$i."').prop('type: text', 'disabled: true'); } else{ $('#changeCatFile".$i."').html('Anuluj'); $('#newCatalogFile".$i."').prop('type: file', 'disabled: false'); } }); } </script> "; } } ?>