sorry, some \ desapears...
![](https://xoops.org/uploads/smil42e7a4b8c2e42.gif)
(maybe a [code] tag bug?)
CODE
function render()
{
xoops_load('XoopsEditorHandler');
$editor_handler = XoopsEditorHandler::getInstance();
$editor_handler->allowed_editors = $this->allowed_editors;
$option_select = new XoopsFormSelect("", $this->name, $this->value);
##[ Incorrect Javascript ]#################################################
// $extra = 'onchange="if(this.options[this.selectedIndex].value.length > 0 ){
// window.document.forms.'.$this->form->getName().'.submit();
// }"';
###########################################################################
// Here is the universal version of this it will work on any system as the location.href is the best method for backward compatibility..
$extra = 'onchange=\'location.href="'.$_SERVER['PHP_SELF'].'?';
foreach ($_GET as $key => $value)
if ($key!=$this->name)
$extra .= $key.'='.$value.'&';
$extra .= $this->name.'="+this.options[this.selectedIndex].value+"';
$extra .= '"\'';
/// End of admendment.
$option_select->setExtra($extra);
$option_select->addOptionArray($editor_handler->getList($this->nohtml));
$this->addElement($option_select);
return parent::render();
}
END_CODE