We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32917
    • 5 Posts
    Проблема собственно вот в чем, возможно ли отправить форму не зная точного количества полей в форме <input type="file" />, поясняю
    то есть при открытии страницы в форме присутствует всего одно поле для загрузки файла <input type="file" />, но если предположим юзер захотел добавить не один файл, а 5 например, то тогда средствами JS он динамически добавляет в форму несколько полей и получается примерно так:
    <form id="test" action="[~[*id*]~]" method="post" enctype="multipart/form-data">
    <input name="doc" eform="Документ ::1:" type="text" />
    <input type="file" name="attachment[]" accept="text/plain,application/msword,application/jpg,application/pdf,text/html" eform="Attachment:file:0">
    <input type="file" name="attachment[]" accept="text/plain,application/msword,application/jpg,application/pdf,text/html" eform="Attachment:file:0">
    <input type="file" name="attachment[]" accept="text/plain,application/msword,application/jpg,application/pdf,text/html" eform="Attachment:file:0">
    <input type="file" name="attachment[]" accept="text/plain,application/msword,application/jpg,application/pdf,text/html" eform="Attachment:file:0">
    <input type="file" name="attachment[]" accept="text/plain,application/msword,application/jpg,application/pdf,text/html" eform="Attachment:file:0">
    <input  type="submit" value="Отправить" />
    <input name="formid" type="hidden" value="test" />
    </form> 
    


    вот чанк отправки сообщения:

    <p>Документ: [+doc+]</p>
    <p>Прикреплённый файл: [+attachment+]</p>
    


    а вот что приходи на почту:

    Документ: Паспорт
    Прикреплённый файл: Array

    вот как мне сделать правильную обработку массива (слить массив в одну переменую ) ?
      • 897
      • 1,620 Posts
        "Und wenn du lange in einen Abgrund blickst, blickt der Abgrund auch in dich hinein."

        Не используйте Revo для "просто сайтов". Используйте Evo

        Who can defeat the Russian bear?