CLOUDSTACK-3333: Start port and end port disabled for protocolnumber

This commit is contained in:
Pranav Saxena 2013-07-05 20:28:39 +05:30
parent 3c69e3e2f0
commit 320e3a42a8
1 changed files with 10 additions and 6 deletions

View File

@ -95,7 +95,8 @@
return name != 'protocolnumber' &&
name != 'icmptype' &&
name != 'icmpcode' &&
name != 'cidrlist';
name != 'cidrlist' &&
name != 'number';
});
var $portFields = $inputs.filter(function() {
var name = $(this).attr('name');
@ -116,6 +117,7 @@
$icmpFields.hide();
$otherFields.hide();
$protocolFields.show().addClass('required');
$portFields.show();
} else if ($(this).val() == 'icmp') {
$icmpFields.show();
$icmpFields.attr('disabled', false);
@ -123,7 +125,13 @@
$otherFields.attr('disabled', 'disabled');
$otherFields.hide();
$otherFields.parent().find('label.error').hide();
} else {
}
else if ($(this).val() == 'all'){
$portFields.attr('disabled', 'disabled');
$portFields.hide();
}
else {
$otherFields.show();
$otherFields.parent().find('label.error').hide();
$otherFields.attr('disabled', false);
@ -131,10 +139,6 @@
$icmpFields.hide();
$icmpFields.parent().find('label.error').hide();
$protocolFields.hide().removeClass('required');
if ($(this).val() == 'all'){
$portFields.attr('disabled', 'disabled');
$portFields.hide();
}
}
});