I am quite new to jinja / flask, I am creating dymnamic form in my flask app:
class CreateForm(FlaskForm):
searchCity = StringField('View forcast of city:', validators=[InputRequired("Please enter the city you want to check weather updates")])
count = IntegerField("Days")
submit = SubmitField("Submit")
form = CreateForm(request.form)
form.count.default = count
form.count.label = "Days" if count > 1 else "Day"
form.count.data = count
and in jinja template:
<form>
<dl>
<dd>{{ form.searchCity.label }} {{ form.searchCity(size=20) }}
for next {{ form.count(size=2) }} {{ form.count.label }}
<input type="submit" class="btn-primary" value="Submit" id="calculate" onclick="getWeatherForcaset(
document.getElementsByName('searchCity')[whole_number].value,
document.getElementsByName('count')[whole_number].value
);" >
</dd>
<dd>
<input type="checkbox" name="exactMatch" checked="checked">Exact Match
<input type="checkbox" name="remember">Remember<br/ >
</dd>
</dl>
</form>
I want to assign class form-group
to searchCity
inputbox !
any help would be greatly appreciated thanks