diff --git a/web/skins/classic/views/js/controlpreset.js b/web/skins/classic/views/js/controlpreset.js index a59acaa64..979a63a85 100644 --- a/web/skins/classic/views/js/controlpreset.js +++ b/web/skins/classic/views/js/controlpreset.js @@ -1,10 +1,12 @@ function updateLabel() { - var presetIndex = $('contentForm').preset.getValue(); + var form = $('contentForm'); + var preset_ddm = form.elements['preset']; + + var presetIndex = preset_ddm[preset_ddm.selectedIndex].value; if ( labels[presetIndex] ) { - $('contentForm').newLabel.value = labels[presetIndex]; + form.newLabel.value = labels[presetIndex]; } else { - $('contentForm').newLabel.value = ""; + form.newLabel.value = ''; } } - -window.addEvent( 'domready', updateLabel ); +window.addEvent('domready', updateLabel);