So, basically in my flask application, i want to read all the element contents present inside table.
<form action="#">
<table >
<tr>
<th><input type="text" id="txtName"/></th>
<th><input type="text" id="txtAdd"/></th>
<th>...</th>
<th>...</th>
</tr>
</table>
<button type="submit">Save Details</button>
</form>
Adding Flask code: Once the form is posted, i am reading all the elements one by one and here i want to read the HTML table embedded inside form as well.
@app.route('/EntityMaster', methods=['GET', 'POST'])
def EntityMaster():
if request.method == 'POST':
entityname = request.form['entityname']
address = request.form['address']
region = request.form['region']
try:
cur = flaskmysql.connection.cursor()
cur.callproc("saveproc", [entityname, address, int(region)])
results = cur.fetchall()
cur.close()
except:
flash("Error occured during adding Entity", "alert-danger")