Skip to content

Instantly share code, notes, and snippets.

@aatronco
Created April 10, 2020 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aatronco/051eba54d10e74e3224cb1e34e1f8ffa to your computer and use it in GitHub Desktop.
Save aatronco/051eba54d10e74e3224cb1e34e1f8ffa to your computer and use it in GitHub Desktop.
<script type="application/javascript">
var dte_fields = function() {
if ($("#order_other_boleta_o_factura").val().includes("Boleta")) {
$("#other_giro,#other_razon_social").hide();
$("#other_giro,#other_razon_social").removeAttr("required");
} else {
$("#other_giro,#other_razon_social").show();
$("#other_giro,#other_razon_social").attr("required", "required");
}
}
$("#order_other_boleta_o_factura").change(dte_fields)
$(document).ready(dte_fields);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment