I'm using WTForms to create a form with fields that have "sub fields" like so -
class TableName(FlaskForm):
schema = StringField('Schema', validators=[DataRequired()], id = 'schema_name')
table = StringField('Table', validators=[DataRequired()], id = 'table_name')
class QaForm(FlaskForm):
test_table_in = FormField(TableName, id = 'test_table')
prod_table_in = FormField(TableName, id = 'prod_table')
Front end looks like this - fields consisting of "sub-fields"
How do I reference this form element in JQuery? I've tried the below but it gives me an "undefined" error when I try to print the variables -
var tables = {
test_table: $('#test_table-schema_name').val() + "." + $('#test_table-table_name').val(),
prod_table: $('#prod_table-schema_name').val() + "." + $('#prod_table-table_name').val()
};