Показать сообщение отдельно
  #10 (permalink)  
Старый 02.12.2019, 12:31
Интересующийся
Отправить личное сообщение для Ganisher Посмотреть профиль Найти все сообщения от Ganisher
 
Регистрация: 07.11.2019
Сообщений: 13

$(function(){
			    $('.container').on('focusout', '#second', function () {
			        let first = +($('#first').val()) || 0,
			        	second = +($('#second').val()) || 0;

			        if (second)
			            if (first <= second) {
			                
			                //let errortext = '<p>The value of first (' + first +') input must be greater than the value of secondone (' + second + ')</p>';
			                let poperror = {
			                    content: '',
			                    html: true,
			                    trigger: 'hover focus',
			                    placement: 'bottom'
			                };
			                $('#second').popover(poperror).popover('enable');
			                $('#second').popover(poperror).text('<p>The value of first (' + first + ') input must be greater than the value of secondone (' + second + ')</p>');
			                $('#second').addClass("errorstyle");
			            } else {
			                $('#second').popover('disable');
			                $('#second').removeClass("errorstyle");
			            }
			    });
			});
Ответить с цитированием