bug 13675

Hide unused text fields for ICMP vs TCP selection
This commit is contained in:
Brian Federle 2012-02-21 13:44:20 -08:00
parent d41ad93f0f
commit 9d954fa815
2 changed files with 13 additions and 2 deletions

View File

@ -1473,11 +1473,18 @@
});
if ($(this).val() == 'icmp') {
$icmpFields.show();
$icmpFields.attr('disabled', false);
$otherFields.attr('disabled', 'disabled');
$otherFields.hide();
$otherFields.parent().find('label.error').hide();
} else {
$otherFields.show();
$otherFields.parent().find('label.error').hide();
$otherFields.attr('disabled', false);
$icmpFields.attr('disabled', 'disabled');
$icmpFields.hide();
$icmpFields.parent().find('label.error').hide();
}
});

View File

@ -670,7 +670,7 @@
var $range = $('<div>').addClass('range').appendTo($td);
$(field.range).each(function() {
$('<input>')
var $input = $('<input>')
.attr({
name: this,
type: 'text'
@ -680,9 +680,11 @@
.appendTo(
$('<div>').addClass('range-item').appendTo($range)
);
if (field.isDisabled) $input.hide();
});
} else {
$('<input>')
var $input = $('<input>')
.attr({
name: fieldName,
type: field.isPassword ? 'password' : 'text'
@ -690,6 +692,8 @@
.addClass(!field.isOptional ? 'required' : null)
.attr('disabled', field.isDisabled ? 'disabled' : false)
.appendTo($td);
if (field.isDisabled) $input.hide();
}
} else if (field.custom) {
$('<div>').addClass('button add-vm custom-action')