I'm building an advanced search with a-tags to filter for first letter abcdefghijklmnopqrstuvwxyz0-9 and also an input field, options fields for other criteria, radio buttons and a submit button. When I click on a letter-filter, it sends it as $_GET variable. But when I then use the input fields it forgets it of course. How can I grab this variable with the submit button before sending it along with all the other variables from the form? Do I have to use JS and AJAX for that? Do you recommend that?
EDIT
so let me rephrase that. I have different variables to send to the server, coming from input fields, radio buttons, option fields but I also want a link for each letter of the alphabet (so it would then list all entries that start with that letter). When I click the submit button it sends all the variables from the input fields but not from the a-tags (cause they are not recognized as form-fields I guess). When I click on the a-tags (a letter) it sends just that very variable to the server which is fine as well. My question is, how can I get the submit button to send everything?
<input type='search' id='search-query' name='q' class='uk-input uk-form-width-medium' placeholder='Suche'>
<p>
<?php
foreach ($alphabet as $abc){
if ($abc == $letter) {
$class = 'current';
}
else $class = '';
echo '<a class="'.$class.'" href="'.$page->url.'?letter='.$abc.'">'.$abc.'</a> ';
}
?>
</p>
<select class="uk-select uk-width-medium" name="what">
<option>Titel</option>
<option>Autor</option>
<option>Erscheinungsdatum</option>
</select>
<label><input class="uk-radio" type="radio" name="how" value="aufsteigend" checked> aufsteigend</label>
<label><input class="uk-radio" type="radio" name="how" value="absteigend"> absteigend</label>
<button class="uk-button uk-button-primary" type="submit">Suche starten</button>
</form>```