adding select all none buttons
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<h1>Course Map Comparison</h1>
|
||||
|
||||
<p>
|
||||
<form method="GET">
|
||||
<form method="GET" id="competitorform">
|
||||
{% for competitor in competitors %}
|
||||
{% if competitor in selected_users %}
|
||||
<input type="checkbox" name="users" value="{{ competitor.id|encode }}" checked>{{ competitor }}<br>
|
||||
@@ -28,8 +28,24 @@
|
||||
<input type="checkbox" name="users" value="{{ competitor.id|encode }}">{{ competitor }}<br>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<button type="button" onclick="selectAll()">Select All</button>
|
||||
<button type="button" onclick="selectNone()">Select None</button>
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
<script>
|
||||
function selectAll() {
|
||||
var checkboxes = document.getElementsByName('users');
|
||||
for (var i=0; i<checkboxes.length; i++) {
|
||||
checkboxes[i].checked = true;
|
||||
}
|
||||
}
|
||||
function selectNone() {
|
||||
var checkboxes = document.getElementsByName('users');
|
||||
for (var i=0; i<checkboxes.length; i++) {
|
||||
checkboxes[i].checked = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</p>
|
||||
<p>Click on a line to see the label. Double click on a line to remove it. Reload to get back all lines.</p>
|
||||
<p>We show your original GPS coordinates on the course. For course time, we use a finer interpolation, to get
|
||||
|
||||
Reference in New Issue
Block a user