Vytvoříme vám e-shop a přivedeme zákazníky. Vyzkoušejte si nás zdarma
Zobrazují se odpovědi 1 až 2 z 2

Pomoc s javascript, upload obrazkov

  1. Ahojte využívam tento skript kde pridávam obrázky, keď kliknem na Pridať ďalší obrázok vyskočí mi nový input, to všetko funguje správne ale ako mám spraviť aby bol vedla toho aj <select> a ked kliknem na pridat dalsi obrazok tak mi prida aj dalsi jednoduchy <select>?
    Kód:
    <script type="text/javascript">
    function add_file_field(){
    var container=document.getElementById('file_container');
    var file_field=document.createElement('input');
    file_field.name='images[]';
    file_field.type='file';
    container.appendChild(file_field);
    var br_field=document.createElement('br');
    container.appendChild(br_field);
    }
    </script>
    
    
    <tr>
                           
    <td>Obrázky</td>
                             
    <td><div id="file_container"><input name="images[]" type="file" title="Vybrať súbor" ><br></div><br><a href="javascript:void(0);" style="text-decoration:underline;" onClick="add_file_field();">Pridať ďalší obrázok</a></td>
                           
    </tr>

  2. Co se právě děje na Webtrhu?
  3. Not sure if I understood your problem but here is an answer :

    <script type="text/javascript">

    window.addEventListener('load', function() {

    var imageSelect = document.getElementById('imageSelect');
    var imageInput = document.getElementById('imageInput');

    imageInput.addEventListener('change', function() {
    var option = document.createElement('option');
    option.name = option.value = option.text = imageInput.value;
    imageSelect.appendChild(option);
    }, false);

    }, false);

    </script>


    <div id="imagesDiv">

    <select id="imageSelect">
    </select>

    <form>
    <input id="imageInput" name="imageInput" type="file" title="Add file">
    </form>

    </div>
    Naposledy upravil KevinBouge : 04.06.2012 v 17:15

Hostujeme u Server powered by TELE3