B #3615: IPv4 not required when use IPAM (#4435)

Signed-off-by: Frederick Ernesto Borges Noronha <fborges@opennebula.systems>
(cherry picked from commit 0cdd029e8d)
This commit is contained in:
Frederick Borges authored and Tino Vazquez committed 2020-03-26 11:14:36 +01:00
1 parent 8d6368dbc1
commit 5c359fcbf1
1 file changed
+20
@@ -110,6 +110,26 @@ define(function(require) {
function _onShow(){
this.securityGroupsTable.refreshResourceTableSelect();
// Deletes required on IPV4 when IPAM selected
$("input[wizard_field=\"IPAM_MAD\"]").change(function(){
var prefix_id = this.id.split("_")[0];
// Obtain the correct id for add_ar window
if (prefix_id == "add"){
prefix_id += "_ar";
}
var dynamic_id = "#" + prefix_id + "_ip_start";
if($(this).val().length>0){
$(dynamic_id).removeAttr("wizard_field");
$(dynamic_id).removeAttr("required");
}else{
$(dynamic_id).attr("wizard_field","IP");
$(dynamic_id).attr("required","required");
}
});
$("input.slaac", this.ar_section).change();
}