Final Update From Caleb
Incorporated all Caleb's changes
This commit is contained in:
@@ -1 +1,20 @@
|
||||
import './Contact.html';
|
||||
import './Contact.html';
|
||||
|
||||
Template.Contact.events({
|
||||
'click .send': function(event, template) {
|
||||
let name = $('input[name="name"]').val();
|
||||
let email = $('input[name="email"]').val();
|
||||
let message = $('textarea[name="content"]').val();
|
||||
|
||||
if(template.$('form')[0].checkValidity() && name !== undefined && name.length > 0 && email !== undefined && email.length > 0 && message !== undefined && message.length > 0){
|
||||
Meteor.call("submitContactForm", name, email, message, function(error, result) {
|
||||
if(error) sAlert.error(error);
|
||||
else sAlert.success("Your message has been received!");
|
||||
});
|
||||
}
|
||||
else {
|
||||
sAlert.error("Form not valid! Try again...");
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user