Error Message: Uncaught TypeError: Cannot read property 'value' of null


#1

Hello,

When trying to enter un new project, I^m having the following error message :smile:
"Uncaught TypeError: Cannot read property ‘value’ of null
dashboard.js?6ac6a19de630b1e70a20d0029a0e3e0634518ce7:10 "

Any help, please ?
Thanks

Below the code

This is the code:
Template.dashboard.events({
‘keyup input[type=text]’: function(event, tmpl){
if(event.which === 27 || event.which === 13){
event.preventDefault();
var project = {};
project.name = tmpl.find(’#projectNameEnter’).value;
Meteor.call(‘saveProject’,project);
}
}

});


#2

Hi,

project.name = tmpl.$('#projectNameEnter').val();
if(project.name) Meteor.call('saveProject',project);

#3

It works.
Many thanks.