I have this code to respond to a form submission on a template:
Template.addJobLoc.events({
'submit form': function(event) {
event.preventDefault();
var username = Session.get("username");
var jobloc = event.target.textJobLoc.val; // <= This is "undefined"...???
Meteor.call('insertJobLocationData', username, jobloc, function(err) {
if (err) {
Session.set("lastErrMsg", "insertJobLocationData failed");
} else {
alert(jobloc + ' inserted');
$('#textJobLoc').val("");
$('#textJobLoc').focus();
} // else
}); // Meteor call
} // submit form event
});
When I step through it in CDT after entering a value in the âtextJobLocâ text input element and clicking the
"Save Job/Location" submit input âbuttonâ, the jobloc values is âundefinedâ
I donât see why they should be - I have entered a value in the text input. Here is the template:
Add a Job/Location
Log In Designation for Job/Location
So why are the values on my form undefined when I select the submit button? Is âvalâ the wrong value to grab?