Sjabloon:Domein form: verschil tussen versies
Uit Dorpsbelang Den Hout
Regel 29: | Regel 29: | ||
-->{{#Widget:Multi upload}}</div><!-- | -->{{#Widget:Multi upload}}</div><!-- | ||
--><div><b>Links</b></div><!-- | --><div><b>Links</b></div><!-- | ||
− | --><div id="links-input-wrapper">{{#arraymap:{{#caprint:@domeininfo[0][Links]}}|,|@@@|<div class="d-flex">{{#tag:wsfield||type=text|name=Links[]|class=form-control mb-4|value=@@@}}{{#tag:wsfield|{{fa|times}}|type=button|class=btn mb-4|onclick=this | + | --><div id="links-input-wrapper">{{#arraymap:{{#caprint:@domeininfo[0][Links]}}|,|@@@|<div class="d-flex">{{#tag:wsfield||type=text|name=Links[]|class=form-control mb-4|value=@@@}}{{#tag:wsfield|{{fa|times}}|type=button|class=btn mb-4|onclick=removeLink(this)}}</div>|}}</div><wsfield type="button" class="btn pull-right" onclick="addLink()" >{{fa|plus}}</wsfield><!-- | |
--></div><!-- | --></div><!-- | ||
--></div><div class="main-wrapper mt-4"><wsfield type="button" class="btn pull-right" onclick="uploadFiles('logo')" >Opslaan</wsfield><wsfield type="button" class="btn pull-right d-none" onclick="postBericht(this, 'Domein')" id="real-submit">Opslaan</wsfield></div></wsform><!-- | --></div><div class="main-wrapper mt-4"><wsfield type="button" class="btn pull-right" onclick="uploadFiles('logo')" >Opslaan</wsfield><wsfield type="button" class="btn pull-right d-none" onclick="postBericht(this, 'Domein')" id="real-submit">Opslaan</wsfield></div></wsform><!-- | ||
Regel 38: | Regel 38: | ||
}) | }) | ||
function addLink(){ | function addLink(){ | ||
− | var newlinkinput = document.createElement(' | + | var newlinkinput = document.createElement('div'); |
− | newlinkinput. | + | newlinkinput.classList.add("d-flex"); |
− | newlinkinput.type = "text" | + | newlinkinput.innerHTML = '<input type="text" name="Links[]" class="form-control mb-4" ><button class="btn mb-4" onclick="removeLink(this)" type="button"><i class="fa fa-times"></i></button>'; |
− | |||
document.getElementById('links-input-wrapper').appendChild(newlinkinput) | document.getElementById('links-input-wrapper').appendChild(newlinkinput) | ||
+ | } | ||
+ | function removeLink(el){ | ||
+ | el.closest('.d-flex').remove() | ||
} | } | ||
</script>}} | </script>}} |
Versie van 18 aug 2020 21:52
Domeinen
{{#arraymap:Voedbal-denhout.nl, Stichting-htb.nl, scoutingdenhout.nl|,|@@@|@@@
|}}Please log in first.