scripter73
Programmer
Hi,
I hope my goal doesn't confuse you.
I have a select list where a user can select years.
I have a button that when clicked populates the select list with a default year "2099". I want "2099" to show in the select list, but it will not as long as it is not an option for the user.
My question. How can I get it to display without having it as an option that the user can pick? The year 2099 is not valid, and I only use it as a dummy year indicator for myself when I receive the data.
Is there a way to "hide" this option from the users?
I know this is a little off-beat, but if someone could help me out, I'd really appreciate it.
Below is a snippet of the code. If you copy it and look in your browser, you'll see what I mean. When you click on the button, it is supposed to populate the select box with 2099, but doesn't because 2099 is not an option.
<html>
<head>
<title>Add Option</title>
</head>
<body>
<form name="form1">
<select name="year">
<option value="Year" selected>Year</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2099"></option>
</select>
<input type="button" name="select_choose" onclick="document.form1.year.value='2099'" value="Choose A Year">
</form>
</body>
</html>
Thanks in advance,
scripter73
I hope my goal doesn't confuse you.
I have a select list where a user can select years.
I have a button that when clicked populates the select list with a default year "2099". I want "2099" to show in the select list, but it will not as long as it is not an option for the user.
My question. How can I get it to display without having it as an option that the user can pick? The year 2099 is not valid, and I only use it as a dummy year indicator for myself when I receive the data.
Is there a way to "hide" this option from the users?
I know this is a little off-beat, but if someone could help me out, I'd really appreciate it.
Below is a snippet of the code. If you copy it and look in your browser, you'll see what I mean. When you click on the button, it is supposed to populate the select box with 2099, but doesn't because 2099 is not an option.
<html>
<head>
<title>Add Option</title>
</head>
<body>
<form name="form1">
<select name="year">
<option value="Year" selected>Year</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2099"></option>
</select>
<input type="button" name="select_choose" onclick="document.form1.year.value='2099'" value="Choose A Year">
</form>
</body>
</html>
Thanks in advance,
scripter73