I am making an app with ionic framework and for some reason, it doesn't want to get data from user input fields.
HTML
<template name="form">
<form>
<div class="list">
<label class="item item-input">
<input type="text" name="fName" placeholder="First Name">
</label>
<label class="item item-input">
<input type="text" name="lName" placeholder="Last Name">
</label>
<label class="item item-input">
<input type="text" name="phone" placeholder="Phone">
</label>
</div>
<button type="submit">Save Contact</button>
</form>
Javacript
Template.form.events({
"form submit": function(event, template) {
var inputFirstName = event.target.fName.value;
var inputLastName = event.target.lName.value;
var inputPhone = event.target.phone.value;
var object = {
fName: inputFirstName,
lName: inputLastName,
phone: inputPhone
}
contactList.insert(object);
return false;
}
})
I've been using the exact same event handler for many projects, but it seems not to be working with ionic. Any ideas what might be wrong?Thanks