<form id="vote_{$contentid}" name="vote_{$contentid}" method="post" action="{APP_URL}?app=vote&controller=vote&action=vote">
  <input name="contentid" type="hidden" value="{$contentid}" />
  <dl>
	<dt>{$title}</dt>
  <!--{if $type=='radio'}-->
      <!--{loop $option $k $v}-->
      <dd><label><input type="{$type}" name="optionid" value="{$v[optionid]}"/>{$v[name]}</label></dd>
      <!--{/loop}-->
  <!--{else}-->
      <!--{loop $option $k $v}-->
      <dd><label><input type="{$type}" name="optionid[]" value="{$v[optionid]}"/>{$v[name]}</label></dd>
      <!--{/loop}-->
  <!--{/if}-->
    <dd><input type="submit" name="submit" value="投票" class="submit"/>　<a href="{APP_URL}?app=vote&controller=vote&action=result&contentid={$contentid}">查看结果</a></dd>
  </dl>
</form>
<script language="javascript">
//验证投票选项
$('#vote_{$contentid}').submit(function(){
	var checkeds = $('#vote_{$contentid} input:checked').length;
	if(checkeds == 0){
		alert('请选择投票选项');
		return false;
	}
	<!--{if $type == 'checkbox'}-->
	if(checkeds > {$maxoptions}){
		alert('最多允许选{$maxoptions}项');
		return false;
	}
	<!--{/if}-->
});
</script>