Hi, tried that, but I need it to replace the options that are already
there. Each time an event occurs it replaces with different options.
This method adds additional options. Also I noticed that the viewable
text is blank. What you have done, adds a property "text" and adds the
value. But this doesn't show.
I rewrote the function and it outputs everything correctly, also in
IE. But now I don't know which function replaces the options. I looked
at the documentation but it doesn't seem like any of the functions
does what I need. Some help will be much appreciated.
var myOptions = function(start, end, type, field){
if(type == 'uur'){
for (var n = start; n <= end; n++){
if(n < 10){
//options = options + '<option value="0'+n+'">0'+n+'</option>';
new Element('option',{'value':'0'+n}).set(field).setText('0'+n);
} else {
//options = options + '<option value="'+n+'">'+n+'</option>';
new Element('option',{'value':n}).set(field).setText(n);
}
}
} else {
for (var n = start; n <= end; n=n+5){
if(n < 10){
//options = options + '<option value=":0'+n+'">0'+n+'</option>';
new Element('option',{'value':'0'+n}).set(field).setText(':0'+n);
} else {
//options = options + '<option value=":'+n+'">'+n+'</option>';
new Element('option',{'value':n}).inject(field).setText(':'+n);