thinkphp中select标签添加方法
thinkphp核心包里关于select标签的部分定义代码如下:
public function _select($attr)
{
$tag = $this->parseXmlAttr($attr,'select');
$name = $tag['name'];
$options = $tag['options'];
$values = $tag['values'];
$output = $tag['output'];
$multiple = $tag['multiple'];
$id = $tag['id'];
$size = $tag['size'];
$first = $tag['first'];
$selected = $tag['selected'];
$style = $tag['style'];
$ondblclick = $tag['dblclick'];
$onchange = $tag['change'];
if(!empty($multiple)) {
$parseStr = '<select id="'.$id.'" name="'.$name.'" multiple="multiple" class="'.$style.'" size="'.$size.'" >';
}else {
$parseStr = '<select id="'.$id.'" name="'.$name.'" class="'.$style.'" >';
}
所以如果要在select标签中添加onChange=class()方法的话,做如下处理就可以了:
<html:select options="artClass" change='class()' name="class_id" id="class_id" />