Multiple Uploads

//Upload multiple image and display it on a repeater$w.onReady(function () { let image = []; $w('#repeater1').data = []; let _id = 0; $w('#uploadButton1').onChange(() => { let name = $w('#uploadButton1').value[0].name; if ($w('#uploadButton1').value !== '') { $w('#uploadButton1').startUpload().then((val) => { console.log(val); _id++ image.push({ 'image': val, 'name': name, '_id': String(_id) }); $w('#uploadButton1').value = ''; repeat(); }) } }); function repeat() { $w('#repeater1').data = image; $w('#repeater1').onItemReady(($item, itemData, i) => { $item('#image10').src = itemData.image.url; $item('#text1').text = itemData.name }) }});

view rawMultiple Uploads Wix code.js hosted with ❤ by GitHub

//Upload multiple image and display it on a repeater

$w.onReady(function () {

let image = [];

$w('#repeater1').data = [];

let _id = 0;

$w('#uploadButton1').onChange(() => {

let name = $w('#uploadButton1').value[0].name;

if ($w('#uploadButton1').value !== '') {

$w('#uploadButton1').startUpload().then((val) => {

console.log(val);

_id++

image.push({

'image': val,

'name': name,

'_id': String(_id)

});

$w('#uploadButton1').value = '';

repeat();

})

}

});

 

function repeat() {

$w('#repeater1').data = image;

$w('#repeater1').onItemReady(($item, itemData, i) => {

$item('#image10').src = itemData.image.url;

$item('#text1').text = itemData.name

})

}

});

view rawMultiple Uploads Wix code.js hosted with ❤ by GitHub