if (1 == $this->getVar('field_required')) {
                        $eltmsg                          = empty($caption) ? \sprintf(\_FORM_ENTER, $name) : \sprintf(\_FORM_ENTER, $caption);
                        $eltmsg                          = \str_replace('"', '\"', \stripslashes($eltmsg));
                        $element->customValidationCode[] = "\nvar hasSelected = false; var selectBox = myform.{$name};"
                                                           . "for (i = 0; i < selectBox.options.length; i++  ) { if ( selectBox.options[i].selected === true && selectBox.options[i].value != '' ) { hasSelected = true; break; } }"