I have a list, similar to the one below, how do I get it to show a
particular value rather than always starting at 01?
I would like to be able to get it to show the current date number, i.e. on
the 15th of a month the list would show 15..
Any assistance would be appreciate.
Many thanks
Derek
<select name="selectday" id="selectday">
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
> I have a list, similar to the one below, how do I get it to show a
> particular value rather than always starting at 01?
I believe you want the attribute "selected".
I believe you also want to know about HTMLDog, a great tutorial and
reference site for HTML (and CSS as well). Here's the page where I found
your answer: <http://www.htmldog.com/reference/htmltags/option/>
The canonical reference site is, of course, the W3C:
<http://www.w3.org/>
<http://www.w3.org/TR/html401/>
<http://www.w3.org/TR/html401/interact/forms.html#h-17.6.1>
>
> I would like to be able to get it to show the current date number, i.e. on
> the 15th of a month the list would show 15..
...
<option value="14">14</option>
<option value="15" selected>15</option>
<option value="16">16</option>
...
as at the W3C. The HTMLDog offers it as:
...
<option value="14">14</option>
<option value="15" selected="selected">15</option>
<option value="16">16</option>
...
The two forms are equivalent and valid, since selected is a boolean
attribute, and can be written in something called minimized form:
<http://www.w3.org/TR/html401/intro/sgmltut.html#didx-boolean_attribute-1>
You'll want to test in many browsers, as usual.
>
> <select name="selectday" id="selectday">
> <option value="01">01</option>
[rest snipped]
> </select>
Two more things:
If you had read this group before posting you might have noticed its low
article count. It's all but dead (or I am the undead). You might also look
at comp.infosystems.www.authoring.html (currently quiet as well, but with
more subscribers).
If you want to munge your e-mail address, you might do better to use a
clearly non-valid address, like <derek...@blueyonder.co.uk.INVALID>.
Yours is possibly valid and some spammer might attempt to send mail to it,
causing servers to attempt delivery. No server is supposed to send or
forward mail (or HTTP requests) to an .invalid domain.
See <http://en.wikipedia.org/wiki/.invalid>
HTH
--
John
<option selected value="03" >03</option>
On Fri, 28 Aug 2009 15:28:33 +0100, "Derek @ Blueyonder"
Many thanks
Derek