Почему я это получу?
Код: Выделить всё
function validateFileInput() {
var ownImage = $('#fileField').val();
console.log(ownImage);
var defaultImage = $('#defImage').val();
console.log(defaultImage);
if (ownImage == "" || defaultImage == "") {
$('#image_error').addClass('error-message');
$(".error-message").css('display', 'inline-block');
return false;
} else {
$('#image_error').removeClass('error-message');
$("#image_error").css('display', 'none');
return true;
}
}
Код: Выделить всё
ownImage = ""
defaultImage = ""
Код: Выделить всё
ownImage = "filename.jpg"
defaultImage = "4" // I'm passing a data-attribute-id here
Подробнее здесь: https://stackoverflow.com/questions/247 ... is-present
Мобильная версия