I am using Meteor, FlowRouter, and Parsley for validation. When I reload the app and enter into the page with the form, I get this error and parsley is not working on the form:
You must bind Parsley on an existing element.
If I leave the page and come back, it works fine. I have the following code initializing the binding:
Template.report.onRendered ->
report = Reports.findOne(_id: FlowRouter.getParam('reportId'))
if report.status == 'finalized'
Session.set('showDistributeReport', true)
else
Session.set('showDistributeReport', false)
$('#status-js').val(report.status)
$('#report-form-js').parsley()
I have been using Parsley and haven't seen this problem on other pages. Any help would be greatly appreciate.