in Education by (1.8m points)
newbie here, so thanks in advance for help! I have a Wordpress site with multiple taxonomies. I'd like to create a very simple form with two select boxes, one for each taxonomy. Then I'd like to use an HTML form with the get method to display posts matching the criteria they requested from the select boxes.

I'm able to do this easy enough if each of the two select boxes are filled out, I get a permalink something like:

(ugly, I know, but it works).

What I can't figure out is what to do if they don't fill out both select boxes. Ideally it would only give the permalink for the one they fill in, so either: or

But instead I'm getting

here is my HTML

<form action="" method="get">

Season: <select name="season">

<option>Select season</option>

<option value="">Select season</option>

<option value="spring">Spring</option>

<option value="summer">Summer</option>

<option value="fall">Fall</option>


Vacation type: <select name="vacations">

<option value="">Select vacation type</option>

<option value="beach">Beach</option>

<option value="ski">Ski</option>


<input type="submit" />


I realize the answer is probably simple but I'm banging my head against a wall so any help is very very much appreciated. Thank you!

JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by (1.8m points)
You can still pass an empty parameter like


but, you would have to preselect one of the options for them like

<option selected="selected" value="">Select vacation type</option>

This way if the form is submitted and the user didn't change their selection it should still pass the parameter of but without a value.

Related questions

0 votes
asked Apr 6 in Education by JackTerrance (1.8m points)