I have a Wtforms FieldList made up of FormFields that I want to dynamically append to.
To start out, the FieldList is blank, and it shows up as a <ul> tag in the rendered HTML (the HTML here is rendered using an instrumented version of the render_field macro Wtforms uses in examples):
<div class=" form-group field-contain ">
<label for="listings" class=" col-md-2 control-label">Listings</label>
<div class="col-md-10">
<ul class="form-control" id="listings"></ul>
</div>
</div>
I also create a Handlebars template that I use to scrape the input and append it as an <li> to the <ul class="form-control" id="listings"> tag. The data is input correctly, here is the HTML after I've
<ul class="form-control" id="listings">
<li class='form-control' id='listing'>
<!-- HTML snipped for brevity -->
</li>
<li class='form-control' id='listing'>
<!-- HTML snipped for brevity -- >
</li>
</ul>
(Note the class='form-control' id='listing' added to the <li> objects were added manually to try to get Wtforms to pick it up)
However, when I do a print(form.listings) serverside it gives me the following output:
<ul id="listings"></ul>
Does anyone know of any special classes/attributes I need to add to the <li> attributes for Wtforms to pick it up serverside? FWIW, if I do a console.log($(form).serialize()) before the form is submitted, the values in the <li>s are in there.