I have created a created a template with school.html,school.css and school.js files.
This is what i have in my school.js file
AutoForm.hooks({
usercreation:{
onSubmit: function(event) {
event.preventDefault();
console.log('hi');
}
}
})
/******************************************/
/* Schools: Event Handlers */
/******************************************/
Template.Schools.events({
//more code
and this is my html
{{ #autoForm schema="Schema.User" class="uc" id="usercreation" collection ="Meteor.users" type="method" meteormethod="usercreation" }}
<fieldset>
<legend>Create an account</legend>
{{> afQuickField name='email' label='Email' }}
{{> afQuickField name='password' type="password" label='Password' }}
{{> afQuickField name='profile.schoolname' label='School Name' }}
{{> afQuickField name='profile.schooldescription' label='School Description' }}
{{> afQuickField name='profile.schoollocation' label='School Location' }}
{{> afQuickField name='profile.schoollogo' label='School Logo' }}
{{> afQuickField name='profile.schooltelephonenumber' label='School Telephone Number' }}
</fieldset>
<input type="submit">
{{ /autoForm }}
I am able to display the form with the submit button. Why is the hook not working?.