How to: Flask Python / WTForms Adding dynamic field -


how can generate fields dynamically in flask wtf forms without using java script dom add fields here in link: h t t p://formvalidation.io/examples/adding-dynamic-field/ example adding field or when delete field delete set on database in images down here.

form 1 row: form 1 row

form multiple rows: form multiple rows

{{ form.hidden_tag() }}  {{ form.book }} {{ form.isbn }}  {{ form.price }}   <button type="button" class="btn btn-default addbutton">     <i class="fa fa-plus"></i> </button>  <button type="submit" class="btn btn-default">submit</button>  

and python class form

class bookform(flaskform):      isbn = stringfield("isbn",[validators.datarequired("please enter isbn number.")])     title = stringfield("titile",[validators.datarequired("please enter book title.")])     price = floatfield("price") 

i saw people proposing class_ thing didn't understand great thanx


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -