I m trying to submit a form without a submit button. This form takes values from custom fields in wordpress, displaying results in another page. I ve been trying with the usual javascript function onchange and nothing happens, I ve tried with functions as well...does anyone know what s wrong with this or if is there a better way to solve it? Can it be something related to Wordpress, or the post method? This is the code for the form:
<form method="get" name="form" action="/busqueda/" >
<div class="search">
<select class="styled" name="author" onChange="this.form.submit();">
<option value="-1" selected>Authors</option>
<?php
$metakey = author ;
$autores = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = %s ORDER BY meta_value ASC", $metakey) );
if ($authors) {
foreach ($authors as $author) {
echo "<option VALUE="" . $author . "">" . $author . "</option>";
}
}
?>
</select>
</div><!-- #search1 -->
</form>
BTW, the form works fine when displaying results with a standard submit button. Any hint of what can be wrong is welcome. Thanks a lot!