Created
June 10, 2013 21:46
-
-
Save pmichali/5752671 to your computer and use it in GitHub Desktop.
Conditional fields based on another
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html' %} | |
{% load i18n %} | |
{% block title %}{% trans "Create Network" %}{% endblock %} | |
{% block page_header %} | |
{% include "horizon/common/_page_header.html" with title=_("Create Network Profile") %} | |
{% endblock page_header %} | |
{% block main %} | |
{% include "admin/nexus1000v/_create_network_profile.html" %} | |
{% endblock %} | |
{% block js %} | |
{{ block.super }} | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
$("#id_segment_type").change(function() { | |
if ($(this).val() == "VLAN" || $(this).val() == "vlan") { | |
$("#id_multicast_ip_range").prop('disabled', true); | |
$("#id_physical_network").prop('disabled', false); | |
} | |
else { | |
$("#id_physical_network").prop('disabled', true); | |
$("#id_multicast_ip_range").prop('disabled', false); | |
} | |
}); | |
}); | |
</script> | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment