Afgelopen dagen heb ik Simple Validation van Insanity Ville in mijn website geïntegreerd.
Het werkte prima, nu heb ik daarnaast op dezelfde pagina Modalbox van okunet.ru geïntegreerd. Modalbox werkt prima, maar nu doet de Simple Validation het niet meer.
Chrome en Firebug geven dit terug:
Uncaught TypeError: Cannot call method 'blur' of null
jQuery.jQuery.extend._Deferred.deferred.resolveWithjquery.js:869
jQuery.jQuery.extend.readyjquery.js:420
jQuery.DOMContentLoadedjquery.js:1055
Conflicteren deze scripts met elkaar, of doe ik iets anders fout.
Alvast bedankt,
Usso
$(document).ready(function() {
var checkUser = function (username) {
//remove all the class add the messagebox classes and start fading
$("#msgbox").removeClass().addClass('messagebox').text('Moment...').fadeIn("slow");
var username = $('#naam').val();
$.post(
"validate.php",
{check: 'username', user: username},
function(data) {
if(data=='no') { //if username not avaiable
$("#msgbox").fadeTo(200,0.1,function() { //start fading the messagebox
//add message and change the class of the box and start fading
$(this).html('Gebruikersnaam bestaat al!').addClass('messageboxerror').fadeTo(900,1);
});
}
else {
$("#msgbox").fadeTo(200,0.1,function() { //start fading the messagebox
//add message and change the class of the box and start fading
$(this).html('Gebruikersnaam is beschikbaar!').addClass('messageboxok').fadeTo(900,1);
});
}
}
)
}
var checkSite = function (username) {
//remove all the class add the messagebox classes and start fading
$("#smsgbox").removeClass().addClass('messagebox').text('Moment...').fadeIn("slow");
var snaam = $('#snaam').val();
$.post(
"validate.php",
{check: 'snaam', site: username},
function(data) {
if(data=='no') { //if username not avaiable
$("#smsgbox").fadeTo(200,0.1,function() { //start fading the messagebox
//add message and change the class of the box and start fading
$(this).html('Sitenaam bestaat al!').addClass('messageboxerror').fadeTo(900,1);
});
}
else {
$("#smsgbox").fadeTo(200,0.1,function() { //start fading the messagebox
//add message and change the class of the box and start fading
$(this).html('Sitenaam is beschikbaar!').addClass('messageboxok').fadeTo(900,1);
});
}
}
)
}
var checkPass = function (password) {
$("#pmsgbox").removeClass().addClass('messagebox').text('Moment...').fadeIn("slow");
var password = $('#pass').val();
var cpassword = $('#passc').val();
if((password != cpassword) || (password == "")) {
$("#pmsgbox").fadeTo(200,0.1,function() { //start fading the messagebox
//add message and change the class of the box and start fading
$(this).html('Wachtwoorden kloppen niet!').addClass('messageboxerror').fadeTo(900,1);
});
}
else {
$("#pmsgbox").fadeTo(200,0.1,function() { //start fading the messagebox
//add message and change the class of the box and start fading
$(this).html('Wachtwoord OK!').addClass('messageboxok').fadeTo(900,1);
});
}
}
var checkEmail = function (email) {
$("#emsgbox").removeClass().addClass('messagebox').text('Moment...').fadeIn("slow");
var email = $("#email").val();
$.post(
"validate.php",
{check: 'email', emailAddress: email},
function(data) {
if(data=='no') { //if username not avaiable
$("#emsgbox").fadeTo(200,0.1,function() { //start fading the messagebox
//add message and change the class of the box and start fading
$(this).html('Dit email-adres is al gekoppeld aan een gebruiker!').addClass('messageboxerror').fadeTo(900,1);
});
}
else if(data=='invalid') { //if username not avaiable
$("#emsgbox").fadeTo(200,0.1,function() { //start fading the messagebox
//add message and change the class of the box and start fading
$(this).html('Dit email-adres is niet geldig!').addClass('messageboxerror').fadeTo(900,1);
});
}
else {
$("#emsgbox").fadeTo(200,0.1,function() { //start fading the messagebox
//add message and change the class of the box and start fading
$(this).html('Email-adres OK!').addClass('messageboxok').fadeTo(900,1);
});
}
}
)
}
$("#naam").blur(checkUser);
$("#snaam").blur(checkSite);
$("#passc").blur(checkPass);
$("#email").blur(checkEmail);
});
function schakel(bla) {
if(bla == "1") {
var blas = "result";
var blad = "form";
}else {
var blas = "form";
var blad = "result";
}
var show = document.getElementById(blas);
var hide = document.getElementById(blad);
hide.style.display = 'none';
show.style.display = 'block';
}
ps: het gaat om regel 96...
ps2: Firebug geeft:
$("#naam") is null
$("#naam").blur(checkUser);
NB: Simple Validation heeft gewerkt!