64 lines
2.2 KiB
HTML
64 lines
2.2 KiB
HTML
{% extends 'base.html' %}
|
|
{% load widget_tweaks %}
|
|
|
|
{% block title %}Editar Cliente{% endblock title %}
|
|
{% block titlePage %}RFC: {{object.RFC}}{% endblock titlePage %}
|
|
|
|
{% block content %}
|
|
|
|
<form method="POST" action=".">
|
|
{% csrf_token %}
|
|
<div class="form-group">
|
|
<label for="{{form.RFC.name}}"><strong> {{form.RFC.label|capfirst}} </strong></label>
|
|
{% render_field form.RFC id+="add" id+=form.RFC.name placeholder=form.RFC.label class="form-control" type="text" autocomplete="off" %}
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="{{form.Nombre.name}}"><strong> {{form.Nombre.label|capfirst}} </strong></label>
|
|
{% render_field form.Nombre id+="add" id+=form.Nombre.name placeholder=form.Nombre.label class="form-control" type="text" autocomplete="off" %}
|
|
</div>
|
|
|
|
<div class="form-group form-check">
|
|
{% render_field form.Activo class+="form-checkbox" type="checkbox" %}
|
|
<label class="form-check-label" for="{{form.Activo.label}}">Activo</label>
|
|
</div>
|
|
<div class="form-group">
|
|
{% render_field form.fecha_baja.label %}
|
|
{% render_field form.fecha_baja placeholder=form.fecha_baja.label class+="form-control" type="date" %}
|
|
</div>
|
|
<button type="submit" class="btn btn-primary">Submit</button>
|
|
</form>
|
|
{% endblock content %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
window.addEventListener("load", (event)=>{
|
|
if(!id_Activo.checked){
|
|
id_fecha_baja.setAttribute('required','')
|
|
}else{
|
|
id_fecha_baja.removeAttribute('requied')
|
|
}
|
|
})
|
|
|
|
id_fecha_baja.addEventListener('click',(event)=>{
|
|
|
|
if(id_Activo.checked){
|
|
event.preventDefault()
|
|
alert('El cliente esta activo necesita deseleccionar "Activo" y colocar fecha baja.')
|
|
return
|
|
}
|
|
})
|
|
id_Activo.addEventListener('click', (event)=>{
|
|
|
|
if(id_Activo.checked){
|
|
id_fecha_baja.value=''
|
|
id_fecha_baja.removeAttribute('required')
|
|
|
|
}else{
|
|
id_fecha_baja.setAttribute('required','')
|
|
}
|
|
})
|
|
</script>
|
|
{% endblock scripts %}
|
|
|
|
|