Vertical space between options

<select name="country">
<option value="1">Germany</option>
<option value="2">France</option>
<option value="3">Italy</option>
<option value="4">Korea</option>
<option value="5">China</option>
<option value="6">Japan</option>
</select>

I like to put a vertical space between Italy and Korea.

The code below can make a vertical space between Italy and Korea, but it goes to next page when a user clicks the submit button.

<select name="country">
<option value="1">Germany</option>
<option value="2">France</option>
<option value="3">Italy</option>
<option value="3">Italy</option>
[COLOR="Red"]<option valu"0">vertical space</option>[/COLOR]
<option value="4">Korea</option>
<option value="5">China</option>
<option value="6">Japan</option>
</select>

I like to make a vertical space visually and it doesn’t go anywhere when a user selects (4) option and clicks the submit button.

The only problem with <optgroup> for the op’s requirements is that it has a fixed space between the groups. I doubt you can use css styles to change the space if you wanted a larger or smaller space than the default.

What you are looking for is the <optgroup> tag.

<select name="country">
<optgroup label="Europe">
<option value="1">Germany</option>
<option value="2">France</option>
<option value="3">Italy</option>
</optgroup><optgroup label="Asia">
<option value="4">Korea</option>
<option value="5">China</option>
<option value="6">Japan</option>
</optgroup>
</select>

The labels will be displayed in the select list but can not be selected.

I can’t think of a way to style a space between options. As a last resort you can always create your own customised “select” by using <ul>. You can easily add space between the <li>'s using css margin.

I would add client-side code to disable the submit button when that option is selected and to enable the submit button when any other option is selected. However, you should also back that up with server side validation to be sure that people browsing without JS don’t slip through the cracks.