AP257 AP257 - 1 month ago 4x
HTML Question

Set value of select element based on GET parameters, without JavaScript?

Here's a very basic HTML question for you:

<form method="get" action="#">
<select id="u" name="u">
<option value="nothing" title=""></option>
<option value="AdamT" title="AT">Adam Temple</option>
<option value="AlexP" title="AP">Alex Potts</option>
<INPUT TYPE="submit" />

After submitting the form, the URL ends
. However, the list has reverted to the blank element.

Is there any way I could make the list be pre-selected with the correct option, without using JavaScript?


Add selected (its a boolean attribute) to the appropriate <option> element in whatever server side language you use to process the form.