Gregory Hill wrote:
>>You shouldn't. By changing the value of a <select> input, it changes
>
> what
>
>>is
>>selected. Does it not work for you?
>>
>
>
> Since when? This hasn't worked in any browser I've ever tried, but
> maybe something has changed since I tried it.
this simple test HTML/JS works fine for me in Firefox 1.0.7 and I'm pretty sure
it works with IE (but I don't have one handy to test with).
<html>
<form id="my_form">
<select id="stuff">
<option value="">--</option>
<option value="foo">Foo</option>
<option value="bar">Bar</option>
</select>
<input type="button" onClick="set_stuff('foo')" value="Foo">
<input type="button" onClick="set_stuff('bar')" value="Bar">
</form>
<script type="text/javascript">
function set_stuff(my_value) {
document.forms['my_form'].elements['stuff'].value = my_value;
}
</script>
</html>
--
Michael Peters
Developer
Plus Three, LP
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs