My field data is undefined

0

My date field in php when I give alert appears as undefined, how to fix?

var menuid =     $("#menuid").val();
var date =       $("#fundation-date").val();
var cnpj =       $("#cnpj").val();
var latitude =   $("#latitude").val();
var longitude =  $("#longitude").val();
var link =       $("#link").val();
var newLink =    $("#newLink").val();
var site =       $("#site").val();
var facebook =   $("#facebook").val();
var instagram =  $("#instagram").val();
var googleplus = $("#googleplus").val();
var pinterest =  $("#pinterest").val();

alert(link + '-  -' + newLink);
alert(menuid);

if (link !== newLink) {
    if (link === null || link === '') {
        $("#link").addClass("input-required");
        moreInformations = false;
    }else{
        repeatLink();
    }
}

alert(date);
alert(cnpj);
alert(latitude);
alert(longitude);
alert(site);
alert(facebook);
alert(instagram);
alert(googleplus);
alert(pinterest);

It manages to catch all, the date passes as undefined ......

    
asked by anonymous 21.09.2016 / 15:11

0 answers