Skip to content

Commit 2786914

Browse files
added validation to countries
1 parent 1fd7b2c commit 2786914

File tree

2 files changed

+42
-7
lines changed

2 files changed

+42
-7
lines changed

apps/paf/fields/index.js

+14-7
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ module.exports = {
367367
},
368368
'boat-country-departure': {
369369
mixin: 'select',
370-
className: ['js-hidden'],
370+
className: ['typeahead','js-hidden'],
371+
validate: ['required', 'notUrl'],
371372
options:
372373
[{
373374
value: '',
@@ -401,7 +402,8 @@ module.exports = {
401402
},
402403
'train-country-departure': {
403404
mixin: 'select',
404-
className: ['js-hidden'],
405+
className: ['typeahead','js-hidden'],
406+
validate: ['required', 'notUrl'],
405407
options:
406408
[{
407409
value: '',
@@ -438,7 +440,8 @@ module.exports = {
438440
},
439441
'airline-country-departure': {
440442
mixin: 'select',
441-
className: ['js-hidden'],
443+
className: ['typeahead','js-hidden'],
444+
validate: ['required', 'notUrl'],
442445
options:
443446
[{
444447
value: '',
@@ -530,7 +533,8 @@ module.exports = {
530533
},
531534
'crime-location-country': {
532535
mixin: 'select',
533-
className: ['js-hidden'],
536+
className: ['typeahead','js-hidden'],
537+
validate: ['required', 'notUrl'],
534538
options:
535539
[{
536540
value: '',
@@ -593,7 +597,8 @@ module.exports = {
593597
},
594598
'crime-another-location-country': {
595599
mixin: 'select',
596-
className: ['js-hidden'],
600+
className: ['typeahead','js-hidden'],
601+
validate: ['required', 'notUrl'],
597602
options:
598603
[{
599604
value: '',
@@ -741,7 +746,8 @@ module.exports = {
741746
},
742747
'report-person-location-outside-uk-address-country': {
743748
mixin: 'select',
744-
className: ['js-hidden'],
749+
className: ['typeahead','js-hidden'],
750+
validate: ['required', 'notUrl'],
745751
options:
746752
[{
747753
value: '',
@@ -767,7 +773,8 @@ module.exports = {
767773
},
768774
'report-person-location-travel-to-uk-country': {
769775
mixin: 'select',
770-
className: ['js-hidden'],
776+
className: ['typeahead','js-hidden'],
777+
validate: ['required', 'notUrl'],
771778
options:
772779
[{
773780
value: '',

apps/paf/translations/src/en/validation.json

+28
Original file line numberDiff line numberDiff line change
@@ -276,5 +276,33 @@
276276
},
277277
"when-to-contact": {
278278
"maxlength": "You can't use more than {{maxlength}} characters for your answer"
279+
},
280+
"boat-country-departure": {
281+
"required": "Enter a valid country",
282+
"notUrl": "Enter a valid country on the list"
283+
},
284+
"airline-country-departure": {
285+
"required": "Enter a valid country",
286+
"notUrl": "Enter a valid country on the list"
287+
},
288+
"crime-location-country": {
289+
"required": "Enter a valid country",
290+
"notUrl": "Enter a valid country on the list"
291+
},
292+
"crime-another-location-country": {
293+
"required": "Enter a valid country",
294+
"notUrl": "Enter a valid country on the list"
295+
},
296+
"train-country-departure": {
297+
"required": "Enter a valid country",
298+
"notUrl": "Enter a valid country on the list"
299+
},
300+
"report-person-location-outside-uk-address-country": {
301+
"required": "Enter a valid country",
302+
"notUrl": "Enter a valid country on the list"
303+
},
304+
"report-person-location-travel-to-uk-country": {
305+
"required": "Enter a valid country",
306+
"notUrl": "Enter a valid country on the list"
279307
}
280308
}

0 commit comments

Comments
 (0)