Good all the time of day, gentlemen.
Form, enter data, submit button - everything works. I want to add input
in which you can select a file to load. Yes, yes, the Internet is full of examples, but I will ask something non-standard. I want to write in the input
only the address of the file (we do not load the file itself). And after entering the address (i.e., if filled), the hunt is a little lower to make another input
(up to 7-10 units). (Eats but without reloading the page.)
Dear, tell me how to implement it?
ps actually here already in the form where I transfer there already and I will think how to load the file, and I will be glad to tips
pps iframe - please do not offer.
Added after 2 hours:
// подключаем JQ // ждем нажатия ссылки у id=text1 <script type="text/javascript"> $(document).ready(function () { $("a").click(function() { var id = $(this).attr('id'); $.ajax({ url: "if.php", type: "POST", data: {id: id}, success: function(text) { $("#text1").append(text); } }); }); }); </script> // в место инпута пишу это <div id="text1"> <a href="#" id="1">Добавить</a> </div> // создаем if.php - здесь будем добавлять input'ы для файлов // и на этом я остановился // echo "1"; // при нажатии на ссылку выше - просто добавляются единицы без перезагрузки
5 hours later: In general , I perceive criticism adequately, and I will be happy with the decision. If I do not find it, I will post my decision. Let not perfect, but it is optimized, which can be customized for yourself (namely, this is the main minus of examples from Ineta)