Widget:Companies/Search: Difference between revisions

From TwogPedia
mNo edit summary
mNo edit summary
Line 1: Line 1:
<div class="companies__search">
<div class="companies__search">
<div style="display: flex; flex-direction: column;">
  <div>
  <label style="display: block;" for="location__name">Name</label>
  <input type="text" id="companies__name" placeholder="Name...">
  </div>
<div>
<div>
   <input type="text" id="companies__name" placeholder="Name...">
  <label for="places">Type</label>
  <select id="types" name="types" onchange="updateTemplate()">
  <option value="">Any</option>
  <option value="Organization">Gaming Organization</option>
  <option value="Locations">Locations</option>
   <option value="Sponsor">Sponsor</option>
  <option value="Organizer">Organizer</option>
  <option value="Other">Other</option>
  </select>
</div>
</div>
</div>


Line 10: Line 24:
function updateTemplate() {
function updateTemplate() {
   var parameters = '';
   var parameters = '';
  let type = document.getElementById("types").value;
  if ( type !== '' ) parameters += '|type=' + document.querySelector(`option[value="${type}"]`).textContent
   let name = document.getElementById("companies__name").value;
   let name = document.getElementById("companies__name").value;
   if ( name !== '' ) parameters += '|name=' + name
   if ( name !== '' ) parameters += '|name=' + name

Revision as of 17:07, 26 March 2024