Mam coś takiego:
<form action="#" enctype="multipart/form-data" method="post"> <input type="radio" name="opcja" onclick="f1()"> <input type="radio" name="opcja" onclick="f2()"> <input type="hidden" name="file" id="file"> <input type="hidden" name="text" id="text"> </form> <script> function f1() { document.getElementById("file").type = "file"; document.getElementById("text").type = "hidden"; } function f2() { document.getElementById("text").type = "text"; document.getElementById("file").type = "hidden"; } </script>
Chciałbym, aby w formularzu można było wybrać albo pole tekstowe albo pole wyboru pliku.
Po wybraniu pierwszej opcji pojawia się pole wyboru pliku ale druga opcja już nie działa.
Z góry dziękuję za pomoc.