2 import { refresh_page } from '../lib/stores.js';
6 function serialize_form(form) {
7 var params = new URLSearchParams();
9 Array.prototype.slice.call(form.elements).forEach(function (field) {
10 if (!field.name || field.disabled || ['submit', 'button'].indexOf(field.type) > -1) return;
12 if (['checkbox', 'radio'].indexOf(field.type) > -1 && !field.checked) return;
13 if (typeof field.value === 'undefined' || field.value === '') return;
15 params.set(field.name, field.value);
22 <form on:submit|preventDefault={(e) => refresh_page(page, serialize_form(e.target))} class="form-inline" role="search" accept-charset="UTF-8" action="">