Last active
October 11, 2016 23:35
-
-
Save remkohdev/a876c35cd1d99eb76ecb6df4dd8efc44 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>My News Sentiment</title> | |
<link href="{{ url_for('static', filename='stylesheets/style.css') }}"> | |
<style type="text/css"> | |
body { | |
margin: 50px; | |
} | |
label { | |
display: inline-block; | |
width: 200px; | |
} | |
button { | |
margin: 20px; | |
} | |
</style> | |
</link> | |
</head> | |
<body> | |
<h1>News Sentiment</h1> | |
<form action="" method="get" id="searchform"> | |
<div> | |
<label for="startdate">Startdate:</label> | |
<input type="date" name="startdate"> | |
</div> | |
<div> | |
<label for="enddate">Enddate:</label> | |
<input type="date" name="enddate"> | |
</div> | |
<div> | |
<label for="searchterm">Search for:</label> | |
<input type="text" name="searchterm"> | |
</div> | |
<div> | |
<label for="">Number of results</label> | |
<select name="count"> | |
<option value="25">25</option> | |
<option value="100">100</option> | |
<option value="500">500</option> | |
<option value="1000">1000</option> | |
</select> | |
</div> | |
<div><button type="submit">Submit</button> </div> | |
</form> | |
<script type=text/javascript src="{{url_for('static', filename='js/jquery/jquery-3.1.1.min.js') }}"></script> | |
<script type=text/javascript src="{{url_for('static', filename='js/jquery-validation/jquery-validation-1.15.1/dist/jquery.validate.min.js') }}"></script> | |
<script type="text/javascript"> | |
var validator = | |
$('#searchform').validate({ | |
rules: { | |
startdate: { | |
required: true | |
}, | |
enddate: { | |
required: true | |
}, | |
searchterm: { | |
required: true | |
}, | |
count: { | |
required: true | |
} | |
}, | |
submitHandler: function (form) { | |
$('form#searchform').attr('action', '/search') | |
form.submit(); | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment