Skip to content

Commit

Permalink
Connect up input-type specific validation
Browse files Browse the repository at this point in the history
This relies on v1.6 of the scorer.
  • Loading branch information
PeterJCLaw committed Nov 17, 2024
1 parent df7f082 commit 48be34a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions scoring/update.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,29 @@
{% macro input_highest(x, y, name) %}
<foreignObject x="{{ x + 5 }}" y="{{ y }}" width="90" height="30">
<input
class="highest"
class="highest tokens"
placeholder="Highest"
type="text"
id="district_{{ name }}_highest"
name="district_{{ name }}_highest"
value="{{ request.form.get('district_{}_highest'.format(name)) | empty_if_none }}"
onkeyup="token_input_change(this);"
pattern="^[GOPY]?$"
/>
</foreignObject>
{% endmacro %}

{% macro input_pallets(x, y, name) %}
<foreignObject x="{{ x + 5 }}" y="{{ y }}" width="90" height="30">
<input
class="pallets"
class="pallets tokens"
placeholder="Pallets"
type="text"
id="district_{{ name }}_pallets"
name="district_{{ name }}_pallets"
value="{{ request.form.get('district_{}_pallets'.format(name)) | empty_if_none }}"
onkeyup="token_input_change(this);"
pattern="^[GOPY]*$"
/>
</foreignObject>
{% endmacro %}
Expand Down Expand Up @@ -70,7 +72,3 @@
</g>
</svg>
{% endblock %}

{% block valid_token_regex %}
var valid_token_regex = /^[GOPY]*$/;
{% endblock %}

0 comments on commit 48be34a

Please sign in to comment.