Welcome Guest, Not a member yet? Register   Sign In
using jquery on checking duplicate data in database with dynamic textfields
#8

[eluser]Vitek[/eluser]
Hi again, clariz,

Looks like my tiredness kicked in after all! The problem is that I used blur() to bind a named function to each textbox, when in fact blur() only takes anonymous functions. You just need to make this small change:

Code:
function checkQuestion() {
    
    $('#txtQuestion').val($(this).val());
                    
    $('#formCheck').ajaxSubmit({
    
        success :  function(response) {                  
            if (response > 0) {
                alert('Question already exists!');
            }                  
        }
    
    });
}

Then replace both blur() calls from the original code with the following line:

Code:
$('#Questions > input').bind('blur', checkQuestion);

I got paranoid and just tested it all and it works fine for me. Let me know how it works for you.


Messages In This Thread
using jquery on checking duplicate data in database with dynamic textfields - by El Forum - 09-22-2008, 09:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB