Hmmm hey again,
Trying to think about something creative:
If there would be a way that the first two fields, put together, will construct the third and then search only by it...
So if I choose only year, it searches by year.
If I choose only prize name, it searches only by prize name.
But if I choose both, it searches only by the third category, prize + name...
How about this:
I can place the three select filters under a div with the same id, and hide only the third. Then:
$('#awards select').on('change', function() {
var yearSelect = $('#awards .year').val();
var awardSelect = $('#awards .title').val();
$('#awards .yearaward').find(yearSelect + "," + awardSelect).attr('selected','selected');
});
Which means whenever any of the first two (year only and award only( change, their selected values are collected, and if there's a matching value of both (plus a comma between) in the third select (year and award together), it gets "selected", and then the search must include "1999", "Booker", and "Booker,1999".
If only one if the first two is selected, there won't be a matching combination in the third, thus it won't be selected.
Could this work?
Ok - Update:
I tried this html:
<div id="awards">
<label>[wpml-string context="wpv-views"]שם הפרס[/wpml-string]</label>
[wpv-control-post-taxonomy taxonomy="awards" type="select" class="awardtitle" default_label="--בחר--" format="%%NAME%% <em>(%%COUNT%%)</em>" url_param="wpv-awards"]
<label>[wpml-string context="wpv-views"]שנות זכיה בפרס[/wpml-string]</label>
[wpv-control-post-taxonomy taxonomy="award-winning-yead" class="awardyear" type="select" default_label="--בחר--" format="%%NAME%% <em>(%%COUNT%%)</em>" url_param="wpv-award-winning-yead"]
</div>
<label>[wpml-string context="wpv-views"]פרסים בשנים[/wpml-string]</label>
[wpv-control-post-taxonomy taxonomy="award-in-year" class="awardandyears" type="select" default_label="--בחר--" url_param="wpv-award-in-year"]
</div>
</div>
with this Jquery:
$('#awards select').on('change', function() {
var yearSelect = $('#awards .awardyear').find(':selected').val();
var awardSelect = $('#awards .awardtitle').find(':selected').val();
$('.awardandyears').find("option[text=[" + yearSelect + "-" + awardSelect + "]").attr('selected','selected');
});
It should have worked (I think), but the problem is that when I select an option from the select menues, the option doesn't get "selected=selected". The first default option stays "selected" forever, and I can't influence the real selected option by code.
Any idea how to get this done?
thx again!