mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-23 08:13:14 +00:00
Small fix in form validation.
This commit is contained in:
parent
5d750596e1
commit
9a9fdb0072
1 changed files with 4 additions and 0 deletions
|
@ -140,9 +140,11 @@
|
|||
if ($('#settings_proxy_type').val() === "None") {
|
||||
$('.proxy_option').hide();
|
||||
$('#settings_form').form('remove rule', 'settings_proxy_url', 'empty');
|
||||
$('#settings_form').form('remove rule', 'settings_proxy_port', 'empty');
|
||||
$('#settings_form').form('remove rule', 'settings_proxy_port', 'integer[1..65535]');
|
||||
} else {
|
||||
$('#settings_form').form('add rule', 'settings_proxy_url', {rules: [{type : 'empty', prompt : '"General / Proxy settings / Hostname" must have a value'}]});
|
||||
$('#settings_form').form('add rule', 'settings_proxy_port', {rules: [{type : 'empty', prompt : '"General / Proxy settings / Port" must have a value'}]});
|
||||
$('#settings_form').form('add rule', 'settings_proxy_port', {rules: [{type : 'integer[1..65535]', prompt : '"General / Proxy settings / Port" must be an integer between 1 and 65535'}]});
|
||||
}
|
||||
|
||||
|
@ -151,12 +153,14 @@
|
|||
if ($('#settings_proxy_type').val() === "None") {
|
||||
$('.proxy_option').hide();
|
||||
$('#settings_form').form('remove rule', 'settings_proxy_url', 'empty');
|
||||
$('#settings_form').form('remove rule', 'settings_proxy_port', 'empty');
|
||||
$('#settings_form').form('remove rule', 'settings_proxy_port', 'integer[1..65535]');
|
||||
$('.form').form('validate form');
|
||||
$('#loader').removeClass('active');
|
||||
} else {
|
||||
$('.proxy_option').show();
|
||||
$('#settings_form').form('add rule', 'settings_proxy_url', {rules: [{type : 'empty', prompt : '"General / Proxy settings / Hostname" must have a value'}]});
|
||||
$('#settings_form').form('add rule', 'settings_proxy_port', {rules: [{type : 'empty', prompt : '"General / Proxy settings / Port" must have a value'}]});
|
||||
$('#settings_form').form('add rule', 'settings_proxy_port', {rules: [{type : 'integer[1..65535]', prompt : '"General / Proxy settings / Port" must be an integer between 1 and 65535'}]});
|
||||
$('.form').form('validate form');
|
||||
$('#loader').removeClass('active');
|
||||
|
|
Loading…
Reference in a new issue