<script type="text/javascript">
$(function() { //防止回车提交表单
	document.onkeydown = function(e){ 
		var ev = document.all ? window.event : e;
		if (ev.keyCode==13) {
			$("#mark").val("1"); // 标识不能提交表单
		}
	}
	$(".table_form th").last().css('border','none');
	$(".table_form td").last().css('border','none');
    dr_type({intval($data.type)});
});
function dr_form_check() {
	if ($("#mark").val() == 0) { 
		return true;
	} else {
		return false;
	}
}

function dr_type(i) {
    $('.vv').hide();
    $('.v'+i).show();
}
</script>
<div class="table-list" style="width:500px;">
    <form action="" method="post" id="myform" name="myform" onsubmit="return dr_form_check()">
    <input name="mark" id="mark" type="hidden" value="0" />
    <table width="100%" class="table_form">
        <tr>
            <th width="100">{fc_lang('类型')}： </th>
            <td>
                {loop $ci->type $i $t}
                <input onclick="dr_type({$i})" name="data[type]" type="radio" value="{$i}" {if $data.type==$i}checked=""{/if}>&nbsp;&nbsp;<label>{$t}</label>&nbsp;&nbsp;&nbsp;&nbsp;
                {/loop}
            </td>
        </tr>
    <tr>
        <th><font color="red">*</font>&nbsp;{fc_lang('名称')}： </th>
        <td>
            <input onblur="d_topinyin('cname','name');" class="input-text" type="text" name="data[name]" id="dr_name" value="{$data.name}" style="width:200px;"><div class="onShow" id="dr_name_tips">{fc_lang('给它一个描述名称')}</div>
        </td>
    </tr>
    <tr>
        <th><font color="red">*</font>&nbsp;{fc_lang('别名')}： </th>
        <td>
            <input class="input-text" type="text" name="data[cname]" id="dr_cname" value="{$data.cname}" style="width:200px;"><div class="onShow" id="dr_cname_tips">{fc_lang('只能是字母或者数字')}</div>
        </td>
    </tr>
    <tr class="vv v0 dr_border_none" style="display:none;height:45px;">
        <th>{fc_lang('变量值')}： </th>
        <td>
            <input name="data[value][0]" type="radio" value="1" {if $data.value}checked=""{/if}>&nbsp;&nbsp;<label>{fc_lang('是')}</label>&nbsp;&nbsp;&nbsp;&nbsp;
            <input name="data[value][0]" type="radio" value="0" {if !$data.value}checked=""{/if}>&nbsp;&nbsp;<label>{fc_lang('否')}</label>&nbsp;&nbsp;&nbsp;&nbsp;
        </td>
    </tr>
    <tr class="vv v1 dr_border_none" style="display:none;height:45px;">
        <th>{fc_lang('变量值')}： </th>
        <td>
            <input class="input-text" type="text" name="data[value][1]" value="{$data.value}" style="width:300px;">
        </td>
    </tr>
    </table>
    </form>
</div>