mirror of https://github.com/interlegis/sapl.git
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							45 lines
						
					
					
						
							1.2 KiB
						
					
					
				
			
		
		
		
			
			
			
		
		
	
	
							45 lines
						
					
					
						
							1.2 KiB
						
					
					
				| {% extends "crud/form.html" %} | |
| {% load i18n %} | |
| {% load crispy_forms_tags %} | |
| {% block extra_js %} | |
|    <script type="text/javascript"> | |
| 
 | |
|     $(document).ready(function(){ | |
|       if($("#id_data_envio").val() != ''){ | |
|         $("#submit-id-excluir").val('Retornar proposição enviada'); | |
|         $("#submit-id-salvar").val('Salvar proposição'); | |
|       }else{ | |
|         $("#submit-id-excluir").val('Excluir proposição'); | |
|         $("#submit-id-salvar").val('Enviar proposição'); | |
|       } | |
|     }); | |
| 
 | |
|  		function disable_fields() { | |
|  			$("#id_tipo_materia").val(""); | |
|  			$("#id_numero_materia").val(""); | |
|  			$("#id_ano_materia").val(""); | |
| 
 | |
| 			$("#id_tipo_materia").attr("disabled", "disabled"); | |
| 			$("#id_numero_materia").attr("disabled", "disabled"); | |
| 			$("#id_ano_materia").attr("disabled", "disabled"); | |
| 			$("#id_data_envio").attr("disabled", "disabled"); | |
|  		} | |
| 
 | |
|  		function enable_fields() { | |
| 			$("#id_tipo_materia").removeAttr('disabled'); | |
| 			$("#id_numero_materia").removeAttr('disabled'); | |
| 			$("#id_ano_materia").removeAttr('disabled'); | |
|  		} | |
| 
 | |
|   	$(function () { | |
|   		disable_fields(); | |
|   		$("#id_tipo").change(function() { | |
|   			if ($("#id_tipo").val() == 9) { // parecer | |
|   				enable_fields(); | |
|   			}else { | |
|   				disable_fields(); | |
|   			} | |
|   		}); | |
|     }); | |
| 	</script> | |
| {% endblock %}
 | |
| 
 |