<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></title> 
<link>http://www.bizeway.net/index.php</link> 
<description><![CDATA[网务通 - 网务公司发展之路]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></copyright>
<item>
<link>http://www.bizeway.net/read.php?</link>
<title><![CDATA[ArthurXF原创给smarty的{html_checkboxes}加js事件]]></title> 
<author>ArthurXF &lt;arthurxf@gmail.com&gt;</author>
<category><![CDATA[PHP]]></category>
<pubDate>Thu, 11 Jun 2009 08:58:55 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?</guid> 
<description>
<![CDATA[ 
	　　ArthurXF是BIWEB WMS开源系统的创始人，关于BIWEB WMS开源系统的介绍，可以访问<a href="http://biweb.cn" target="_blank">biweb.cn</a><br/>　　smarty里面的{html_checkboxes}是用来自动生成html的checkbox的，非常方便和实用。例如下面的例子：<br/><?php<br/><br/>$smarty->assign('cust_checkboxes', array(<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1000 => 'Joe Schmoe',<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1001 => 'Jack Smith',<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1002 => 'Jane Johnson',<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1003 => 'Charlie Brown')<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );<br/>$smarty->assign('customer_id', 1001);<br/><br/>?> &nbsp;<br/><br/>上面的赋值在模版里写入下面的smarty语句<br/><br/>{html_checkboxes name='id' options=$cust_checkboxes &nbsp;selected=$customer_id separator='<br />'}<br/> <br/>就可以自动生成下面的html代码。多简单省事啊。<br/><label><input type="checkbox" name="id[]" value="1000" />Joe Schmoe</label><br /><br/><label><input type="checkbox" name="id[]" value="1001" checked="checked" />Jack Smith</label><br/><br /><br/><label><input type="checkbox" name="id[]" value="1002" />Jane Johnson</label><br /><br/><label><input type="checkbox" name="id[]" value="1003" />Charlie Brown</label><br /><br/> <br/>不过当我们需要在下面的input上加onclick事件如何来写呢？手册上也没看到例子，并且写的不明不白。我ArthurXF本以后要去扩展smarty了，谁知道看了源代码之后发现要实现这个功能太容易了。请看我写的例子。<br/><br/>{html_checkboxes name='id' options=$cust_checkboxes &nbsp;selected=$customer_id separator='<br />' onclick="alert('ok')"}<br/><br/>这样就可以了，呵呵，是不是非常简单啊？请转载的兄弟姐妹，帮忙推广一下BIWEB WMS开源系统。<a href="http://biweb.cn" target="_blank">biweb.cn</a><br/>Tags - <a href="tag.php?tag=php" rel="tag">php</a> , <a href="tag.php?tag=smarty" rel="tag">smarty</a> , <a href="tag.php?tag=html_checkboxes" rel="tag">html checkboxes</a> , <a href="tag.php?tag=js" rel="tag">js</a>
]]>
</description>
</item><item>
<link>http://www.bizeway.net/read.php?&amp;guid=0#topreply</link>
<title><![CDATA[[评论] ArthurXF原创给smarty的{html_checkboxes}加js事件]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?&amp;guid=0#topreply</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>