magento使用php将js函数调用添加到输入中


magento add js function call to input with php

我正在尝试对magento的高级搜索进行一些更改。我想让输入一个接一个地出现。所以我需要在每个输入中放入一个onchange='showNext()',但输入是由PHP生成的,如下所示:

return $this -> _getSelectBlock() -> setName($name) -> setId($attribute 
->getAttributeCode()) -> setTitle($this -> getAttributeLabel($attribute)) 
-> setExtraParams("") -> setValue($this -> getAttributeValue($attribute))
-> setOptions($options) -> getHtml();

谢谢你的帮助。

尝试这个

return $this -> _getSelectBlock() -> setName($name) -> setId($attribute 
->getAttributeCode()) -> setTitle($this -> getAttributeLabel($attribute)) 
-> setExtraParams("onchange=''showNext()''") -> setValue($this -> getAttributeValue($attribute))
-> setOptions($options) -> getHtml();