{% extends "data_edit.html" %}
{% load i18n %}

{% block form %}
{% autoescape off %} 
<tr><td>

  <table width="100%" border="0" cellspacing="0" cellpadding="3">
     <div id="country">
		<tr>
       		<th height="20">{{ form.country|field_as_label_tag }}</th>
       		<td>{{form.country.as_widget }}</td>
       		<td>{{form.country.errors }}</td>
   		</tr>
	</div>
    <div id="state">
    	<tr>
        	{{form.state_name|field_as_td_h}}
      		<td  >{{form.state_name.errors }}</td>
      
   		</tr>
    	<tr>
        	{{form.state_code|field_as_td_h}}
	 
      		<td>{{form.state_code.errors }}<div id="yanzheng"  class="floatL Link_blue1 lineH22"><a href="javascript:void(0)" onclick="wgCheckNo('state_code','div_id_code',this,'{{dbapp_url}}','personnel','State')">{%trans '验证'%}</a></div><div id='div_id_code'  class="floatL color_orange lineH22"></div></td>
     
    	</tr>
   	</div> 	

   {% for i,k in form.errors.items %}
   {{i}}{{k}}
   {% endfor %}
   

  </table>
</td></tr>

{% endautoescape %}
{% endblock %}
{% block addjs %}
	$("label[for='id_code']").attr("class","required");
	$(function(){
		if($("#id_edit_form").find("#id_state_code").val()!=""){
			$("#yanzheng").hide();
		 }else{
			 $("#yanzheng").show();
		 }
	});
{% endblock %}