Disable DN/Rig fields on registration for DN calls
When a user enters a call beginning with DN on the registration page we now disable the DN-call and rig question fields, so we don't confuse our SWLs.
This commit is contained in:
parent
2aef677abd
commit
500b79e67a
|
@ -21,5 +21,33 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
function isDNCall(e) {
|
||||
var call = $("#id_username").val().toUpperCase();
|
||||
var disableState = false;
|
||||
console.log("NOOT NOOT" + call);
|
||||
if(call.startsWith("DN")) {
|
||||
var disableState = true;
|
||||
console.log("TIME TO DISABLE SHIT");
|
||||
}
|
||||
|
||||
$("#id_dncall").prop("disabled", disableState);
|
||||
$("#id_qrv2m").prop("disabled", disableState);
|
||||
$("#id_qrv70cm").prop("disabled", disableState);
|
||||
$("#id_extra2m70cm").prop("disabled", disableState);
|
||||
if(disableState) {
|
||||
$("#id_dncall").prop("value", "");
|
||||
$("#id_qrv2m").prop("checked", false);
|
||||
$("#id_qrv70cm").prop("checked", false);
|
||||
$("#id_extra2m70cm").prop("checked", false);
|
||||
}
|
||||
console.log($("#id_dncall"));
|
||||
}
|
||||
|
||||
$("#id_username").on("input", isDNCall);
|
||||
$("#id_username").change(isDNCall);
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue