Показать сообщение отдельно
  #1 (permalink)  
Старый 19.12.2016, 23:55
Профессор
Отправить личное сообщение для porezon Посмотреть профиль Найти все сообщения от porezon
 
Регистрация: 09.01.2013
Сообщений: 167

Проблема между js
Здравствуйте! Есть такая проблема, есть проверка формы на ввод данных, если форму ставлю на обычной странице то все хорошо, но если вставляю на всплывающую она не работает


Код самой формы проверки

jQuery(function(){
       $('.text').val('');

    $('#email').blur(function checkMail(){
        var emailV = $('#email').val();
        var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,6})+$/;
        if (filter.test(emailV)) {
        document.getElementById("e_login1").style.display = "inline";
        document.getElementById("e_login").style.display = "none"; 
        }else{
        document.getElementById("e_login").style.display = "inline";
        document.getElementById("e_login1").style.display = "none";
        }
    });

        $('#username').blur(function(){
        var nameLngth = $('#username').val().length;
        if(nameLngth <= 1){
        document.getElementById("u_login").style.display = "inline";
        document.getElementById("u_login1").style.display = "none";
        } else {
        document.getElementById("u_login1").style.display = "inline";
        document.getElementById("u_login").style.display = "none"; 
        }
    });
    
   
    $('#password').blur(function(){
        var nameLngth = $('#password').val().length;
        if(nameLngth <= 1){
        document.getElementById("p_login").style.display = "inline";
        document.getElementById("p_login1").style.display = "none";
        } else {
        document.getElementById("p_login1").style.display = "inline";
        document.getElementById("p_login").style.display = "none"; 
        }
    });

        $('#cpassword').blur(function(){
        var nameLngth = $('#cpassword').val().length;
        if(nameLngth <= 1){
        document.getElementById("ps_login").style.display = "inline";
        document.getElementById("ps_login1").style.display = "none";
        } else {
        document.getElementById("ps_login1").style.display = "inline";
        document.getElementById("ps_login").style.display = "none"; 
        }
    });


    $('#pincode').blur(function(){     
        var phoneV = $('#pincode').val();
        var phoneLngth = phoneV.length;

        if( /[^0-9]/.test(phoneV) ) {
    document.getElementById("c_login").style.display = "inline";
    document.getElementById("c_login1").style.display = "none";
        } else if (phoneLngth <= 3) {
    document.getElementById("c_login").style.display = "inline";
    document.getElementById("c_login1").style.display = "none";
        } else {
    document.getElementById("c_login1").style.display = "inline";
    document.getElementById("c_login").style.display = "none"; 
        }
    });

        $('#name').blur(function(){
        var nameLngth = $('#name').val().length;
        if(nameLngth <= 1){
        document.getElementById("n_login").style.display = "inline";
        document.getElementById("n_login1").style.display = "none";
        } else {
        document.getElementById("n_login1").style.display = "inline";
        document.getElementById("n_login").style.display = "none"; 
        }
    });

        $('#surname').blur(function(){
        var nameLngth = $('#surname').val().length;
        if(nameLngth <= 1){
        document.getElementById("s_login").style.display = "inline";
        document.getElementById("s_login1").style.display = "none";
        } else {
        document.getElementById("s_login1").style.display = "inline";
        document.getElementById("s_login").style.display = "none"; 
        }
    });
    
});



код всплывающего окна в которой появляется форма



function stats(id) {
var http = createRequestObject();
        document.getElementById('box').style.display = 'block';
        if( http )
        {
            http.open('GET', 'ajax/info.php?id='+id);
            http.onreadystatechange = function ()
            {
                if(http.readyState == 4)
                {

                    document.getElementById('outbox').innerHTML = http.responseText;
                    document.getElementById('outbox').style.display = 'block';
                }
            }
            http.send(null);
        }

    }

function createRequestObject()
    {
        try { return new XMLHttpRequest() }
        catch(e)
        {
            try { return new ActiveXObject('Msxml2.XMLHTTP') }
            catch(e)
            {
                try { return new ActiveXObject('Microsoft.XMLHTTP') }
                catch(e) { return null; }
            }
        }
    }



подскажите как решить эту проблему
Ответить с цитированием