html - Set value of select element based on GET parameters, without JavaScript? -
here's basic html question 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> </select> <input type="submit" /> </form>
after submitting form, url ends ?u=adamt
. however, list has reverted blank element.
is there way make list pre-selected correct option, without using javascript?
add selected
(its boolean attribute) appropriate <option>
element in whatever server side language use process form.
Comments
Post a Comment