Skip to content

Commit

Permalink
form validations and messaging for dropdowns working as per specs
Browse files Browse the repository at this point in the history
  • Loading branch information
horatiorosa committed Oct 29, 2024
1 parent cfb56c5 commit 289fc5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@
@placeholder='select a borough' as |borough|>
{{borough.label}}
</PowerSelect>
{{#if form.errors.borough}}
{{#each form.errors.borough.validation as |message|}}
<div class="form-error is-visible" data-test-validation-message="select a borough">{{message}}</div>
{{/each}}
{{/if}}
</Ui::Question>

<Ui::Question @required={{true}} as |Q|>
<Q.Label data-test-projects-new-applicant-type>
Applicant Type
Expand All @@ -48,6 +52,12 @@
@placeholder='select applicant type' as |dcpApplicantType| >
{{dcpApplicantType.label}}
</PowerSelect>
{{#if form.errors.applicantType}}
{{#each form.errors.applicantType.validation as |message|}}
<div class="form-error is-visible" data-test-validation-message="select an Applicant Type"> {{message}}
</div>
{{/each}}
{{/if}}
</Ui::Question>
</form.Section>
{{/let}}
Expand Down
2 changes: 1 addition & 1 deletion client/app/validations/submittable-projects-new-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default {
message: 'Please select a Borough',
}),
],
dcpApplicantType: [
applicantType: [
validatePresence({
presence: true,
message: 'Please select an Applicant Type',
Expand Down

0 comments on commit 289fc5e

Please sign in to comment.