| 1 |
// $Id: activeselect.js,v 1.17 2006/04/14 15:07:50 jaza Exp $ |
// $Id: activeselect.js,v 1.18 2007/01/05 15:57:53 jaza Exp $ |
| 2 |
|
|
| 3 |
/** |
/** |
| 4 |
* Attaches the activeselect behaviour to all required fields |
* Attaches the activeselect behaviour to all required fields |
| 149 |
// 'new Option()' used instead of appendChild(), because IE6 refuses to |
// 'new Option()' used instead of appendChild(), because IE6 refuses to |
| 150 |
// display option text if the latter method is used (otherwise they seem |
// display option text if the latter method is used (otherwise they seem |
| 151 |
// to behave the same). |
// to behave the same). |
| 152 |
$(this.targets[targetIndex]).append(new Option(text, value, false, selected)); |
this.targets[targetIndex].options.push(new Option(text, value, false, selected)); |
| 153 |
if (selected && !this.targets[targetIndex].multiple) { |
if (selected && !this.targets[targetIndex].multiple) { |
| 154 |
this.targets[targetIndex].selectedIndex = this.targets[targetIndex].options.length-1; |
this.targets[targetIndex].selectedIndex = this.targets[targetIndex].options.length-1; |
| 155 |
} |
} |