Switched static labels and elements out for form.url and others
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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.' }}
|
||||
|
||||
Reference in New Issue
Block a user