Switched static labels and elements out for form.url and others

This commit is contained in:
Maximilian Wagner
2023-07-30 14:07:00 +02:00
parent 62ab798e7c
commit 9929b34bdb
2 changed files with 6 additions and 5 deletions

View File

@@ -1,7 +1,8 @@
from flask_wtf import FlaskForm
from wtforms import URLField
from wtforms import URLField, SubmitField, Label
from wtforms.validators import URL, DataRequired
class DownloadForm(FlaskForm):
url = URLField('url', validators=[DataRequired(), URL()])
url = URLField('Video, Channel or Playlist', validators=[DataRequired(), URL()], render_kw={'placeholder': 'YouTube Link'})
submit = SubmitField('submit')

View File

@@ -4,9 +4,9 @@
<div class="container">
<form method="POST">
{{ form.csrf_token }}
<label for="url">Video, Channel or Playlist</label> <br>
<input id="url" name="url" required type="url" placeholder="YouTube Link">
<input type="submit" value="Go">
{{ form.url.label }} <br>
{{ form.url }}
{{ form.submit }}
</form>
{% if form.errors %}
{{ form.errors['url'][0][:-1] + ', try again.' }}