I am creating a custom search form and I have this code with first option
<select name="something">
<option selected>Choose</option>
<option value="a">A</option>
<option value="b">B</option>
<option value="c">C</option>
</select>
<select name="something2">
<option selected>Choose</option>
<option value="a">A</option>
<option value="b">B</option>
<option value="c">C</option>
</select>
This is what I get in url if I select only something from second select options.
?s=&something=ChooseB&something2=B
Is it possible for form to not send this “Choose” value? Can it be done using Html or do I have to use Jquery? I am doing this in WordPress if it matters.
Try This:
No it is not possible because “choose” is also an option.
One condition is possible, first write html code and set the value of choose option empty.
and then add this javascript code ,this code return false and not submit form if select option is choose that is empty.
OR Simple you can do this
Just leave a space in the value. Like value=” “. This works.