In thinkphp, when editing a piece of data, the drop-down box is automatically selected without using JS
<select name="auth_pid" id="auth_pid">
<option value="0" >--请选择--</option>
<volist name="auth_list" id="item">
<eq name="item.auth_id" value="$auth_info.auth_pid">
<option value="<{$item.auth_id}>" selected ><{$item.auth_name}></option>
<else />
<option value="<{$item.auth_id}>" ><{$item.auth_name}></option>
</eq>
</volist>
</select>
Copy after login
*Red text: The value that needs to be used to fix the comparison
*Blue text: The value of each record looped out that needs to be compared
http://www.bkjia.com/PHPjc/1076510.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1076510.htmlTechArticlethinkphp does not need JS to automatically select the drop-down box when editing a piece of data select name=auth_pid id=auth_pid option value= 0 --Please select--/option volist name=auth_list id=item eq name=it...