meteor - Handling form submittion -
i have form within modal , don't seem able catch submit event.
let's have html page defined (for sake of simplicity leaving out templates defined me)
<body> <button class="ui button">open modal</button> <div class="ui small modal"> <div class="header"> enter email </div> <div class="content"> <form class="ui form"> <div class="field"> <div class="ui left icon input"> <i class="at icon"></i> <input type="email" name="email" placeholder="email"> </div> </div> <div class="ui error message"> </div> </form> </div> <div class="actions"> <div class="ui negative button"> cancel </div> <div class="ui positive primary loadable button"> reset password </div> </div> </div> </body>
and registred template events
template.body.events({ 'click button': function () { $('.modal').modal('show'); }, 'submit form': function () { alert('called'); } });
when submit form doesn't cought handler. why , what's best approach?
i got similar working defining inner content of modal template, makes things harder. there other way?
edit: here's meteorpad demostrates issue
the reason behind behavior modal detached dom. behavior can overriden setting detachable: false
here's working meteorpad
Comments
Post a Comment