Sjabloon:Bericht: verschil tussen versies
Uit Dorpsbelang Den Hout
Regel 33: | Regel 33: | ||
--><div class="grid-lijst"><!-- | --><div class="grid-lijst"><!-- | ||
--><div><b>Aanvullende informatie:</b></div><!-- | --><div><b>Aanvullende informatie:</b></div><!-- | ||
− | -->{{#ifeq:{{#urlget:mode}}|edit| | + | -->{{#ifeq:{{#urlget:mode}}|edit| --><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=removeLink(this)}}</div>|}}</div><wsfield type="button" class="btn pull-right" onclick="addLink()" >{{fa|plus}}</wsfield><!-- | | ||
+ | --></div>{{#tag:html|<script> | ||
+ | |||
+ | |||
+ | }) | ||
+ | function addLink(){ | ||
+ | var newlinkinput = document.createElement('div'); | ||
+ | newlinkinput.classList.add("d-flex"); | ||
+ | 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) | ||
+ | } | ||
+ | function removeLink(el){ | ||
+ | el.closest('.d-flex').remove() | ||
+ | } | ||
+ | </script>}}|}}<!-- | ||
--></div><!-- | --></div><!-- | ||
--><div class="grid-img"><!-- | --><div class="grid-img"><!-- |