diff --git a/src/main.css b/src/main.css index 7b03ca015c..88123fc42a 100755 --- a/src/main.css +++ b/src/main.css @@ -605,4 +605,9 @@ label.checkbox input:checked ~ span.check { .ui-dialog-titlebar { display: flex; align-items: center; -} \ No newline at end of file +} + +.error-field { + border-color: #c03!important; + color: #c03; +} \ No newline at end of file diff --git a/src/trade/tradeDialog.es6 b/src/trade/tradeDialog.es6 index 3f4eee8072..0867c9641b 100644 --- a/src/trade/tradeDialog.es6 +++ b/src/trade/tradeDialog.es6 @@ -628,6 +628,8 @@ function init_state(available,root, dialog, symbol, contracts_for_spot){ if (!range) return; state.duration_count.min = range.min; state.duration_count.max = range.max; + $('#minimum_hint').html(range.min) + $('#maximum_hint').html(range.max) if(try_to_keep_value !== true) { state.duration_count.value = range.min; } @@ -800,6 +802,25 @@ function init_state(available,root, dialog, symbol, contracts_for_spot){ }); } + var $duration_input = $('#duration-input') + var $duration_hint_minimum = $('#duration-hint-minimum') + var $duration_hint_maximum = $('#duration-hint-maximum') + if($duration_input.val() < state.duration_count.min){ + $duration_input.addClass('error-field') + $duration_hint_maximum.addClass('invisible') + $duration_hint_minimum.removeClass('invisible') + } + else if($duration_input.val() > state.duration_count.max){ + $duration_input.addClass('error-field') + $duration_hint_minimum.addClass('invisible') + $duration_hint_maximum.removeClass('invisible') + } + else{ + $duration_hint_maximum.addClass('invisible') + $duration_hint_minimum.addClass('invisible') + $duration_input.removeClass('error-field') + } + async function subscribeProposalHandler(request, times_to_retry, required_err_code_for_retry) { let response; for (let i = 0; i < times_to_retry; i++) { diff --git a/src/trade/tradeDialog.html b/src/trade/tradeDialog.html index 80c2c088ba..91368b42cf 100644 --- a/src/trade/tradeDialog.html +++ b/src/trade/tradeDialog.html @@ -106,6 +106,15 @@ +