Задать вопрос
Ответы пользователя по тегу HTML
  • Danger Message в Bootstrap срабатывает только 1 раз. Как пофиксить?

    @nesipe Автор вопроса
    Я монстр. Удалось!
    function checkForm(){
        var email = document.getElementById("email").value;
        var totalItems = document.getElementById("totalItems")
        var message = '<div class="alert alert-warning fade in">' +
          '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>'+
          '<strong>Incorrect Email'+
          '</div>';
        var pattern = /^([a-z0-9_\.-])+@[a-z0-9-]+\.([a-z]{2,4}\.)?[a-z]{2,4}$/i;
        if(!pattern.test(email)){
         document.getElementById("errorBlock").innerHTML = message;
        }
        else
        document.getElementById("orderForm").submit();
    }
    Ответ написан
    Комментировать