# \#input-validation

**URL:** https://forum.elixirforum.com/tag/input-validation/1402.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [Unexpected error using message: {msg, opts} option in validation code](https://forum.elixirforum.com/t/unexpected-error-using-message-msg-opts-option-in-validation-code/69097)

<div class="topic-metadata">

**Author:** [@neurodynamic](https://forum.elixirforum.com/u/neurodynamic)\
**Replies:** 2\
**Last updated:** [January 30, 2025, 11:33pm UTC](https://forum.elixirforum.com/t/unexpected-error-using-message-msg-opts-option-in-validation-code/69097 "2025-01-30T23:33:36Z")

</div>

I’ve been trying to use the {msg, opts} tuple variant of the :message option in validate\_format, taking a validation that looked like this: |\> validate\_format(:field, ~r/some\_regex/, message: "oh no!") to this |\> vali…

---

## [How does LiveView keep track of which forms fields have been altered?](https://forum.elixirforum.com/t/how-does-liveview-keep-track-of-which-forms-fields-have-been-altered/56014)

<div class="topic-metadata">

**Author:** [@FeeJai](https://forum.elixirforum.com/u/FeeJai)\
**Replies:** 4\
**Last updated:** [July 11, 2023, 1:51am UTC](https://forum.elixirforum.com/t/how-does-liveview-keep-track-of-which-forms-fields-have-been-altered/56014 "2023-07-11T01:51:05Z")

</div>

I am currently building a form that contains an input type=date and a select which allows users to chose a location. Depending on the location, the time zone changes and with it the allowed date range. To validate, I ha…

---

## [Using Ecto without a database](https://forum.elixirforum.com/t/using-ecto-without-a-database/46776)

<div class="topic-metadata">

**Author:** [@derek-zhou](https://forum.elixirforum.com/u/derek-zhou)\
**Replies:** 7\
**Last updated:** [January 25, 2023, 7:35pm UTC](https://forum.elixirforum.com/t/using-ecto-without-a-database/46776 "2023-01-25T19:35:39Z")

</div>

I plan to use Ecto only to validate input data, such as a data structure passed in through a JSON api call, before doing some processing then route the result to somewhere else. There is no SQL database involved. Does it…

---

## [LiveView phx-change attribute does not emit event on input text](https://forum.elixirforum.com/t/liveview-phx-change-attribute-does-not-emit-event-on-input-text/21280)

<div class="topic-metadata">

**Author:** [@komlanvi](https://forum.elixirforum.com/u/komlanvi)\
**Replies:** 33\
**Last updated:** [June 21, 2022, 5:20pm UTC](https://forum.elixirforum.com/t/liveview-phx-change-attribute-does-not-emit-event-on-input-text/21280 "2022-06-21T17:20:22Z")

</div>

Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the text change. So I added phx-change attribute on every input (I only have text, email …

---

## [Commanded + Domo to validate type/format of Commands and Events](https://forum.elixirforum.com/t/commanded-domo-to-validate-type-format-of-commands-and-events/42887)

<div class="topic-metadata">

**Author:** [@IvanR](https://forum.elixirforum.com/u/IvanR)\
**Replies:** 7\
**Last updated:** [October 27, 2021, 11:47pm UTC](https://forum.elixirforum.com/t/commanded-domo-to-validate-type-format-of-commands-and-events/42887 "2021-10-27T23:47:20Z")

</div>

It was an elegant “Eventsourcing and CQRS in Elixir” talk given by @vasspilka at ElixirConf EU 2021. It shows how to use the Commanded library by @slashdotdash to model a Bank domain with the Domain-Driven Design approa…

---

## [Embed Validation for Form data](https://forum.elixirforum.com/t/embed-validation-for-form-data/35753)

<div class="topic-metadata">

**Author:** [@Xantrac](https://forum.elixirforum.com/u/Xantrac)\
**Replies:** 0\
**Last updated:** [November 24, 2020, 3:48am UTC](https://forum.elixirforum.com/t/embed-validation-for-form-data/35753 "2020-11-24T03:48:40Z")

</div>

Good evening, I’m working on a system where an ecto schema has an embed JSON field. I was trying to figure out what is the best option. The schema schema "integrations" do field :type, :string field :configu…

---

## [Struggling with currency/amount input fields (Money)](https://forum.elixirforum.com/t/struggling-with-currency-amount-input-fields-money/33198)

<div class="topic-metadata">

**Author:** [@Sanjibukai](https://forum.elixirforum.com/u/Sanjibukai)\
**Replies:** 13\
**Last updated:** [September 5, 2020, 5:20am UTC](https://forum.elixirforum.com/t/struggling-with-currency-amount-input-fields-money/33198 "2020-09-05T05:20:50Z")

</div>

Hello all, I have a form with one price input field. In order to follow industry standards (and for learning purpose) I’m using Money. Currently I’m only dealing with only one currency (EUR), so I’m not into currency …

---

## [Custom changeset validations return error protocol Enumerable not implemented for #Ecto.Changeset](https://forum.elixirforum.com/t/custom-changeset-validations-return-error-protocol-enumerable-not-implemented-for-ecto-changeset/30223)

<div class="topic-metadata">

**Author:** [@tankh7](https://forum.elixirforum.com/u/tankh7)\
**Replies:** 1\
**Last updated:** [March 30, 2020, 7:34pm UTC](https://forum.elixirforum.com/t/custom-changeset-validations-return-error-protocol-enumerable-not-implemented-for-ecto-changeset/30223 "2020-03-30T19:34:06Z")

</div>

I’m having an issue with my custom changeset validations. There is a form where a user can change their White Labeling colors for their app. I have created custom validations that make sure the colors submitted are eithe…

---

## [Please how do you validate url inputs in your Phoenix projects forms?](https://forum.elixirforum.com/t/please-how-do-you-validate-url-inputs-in-your-phoenix-projects-forms/28268)

<div class="topic-metadata">

**Author:** [@Kurisu](https://forum.elixirforum.com/u/Kurisu)\
**Replies:** 20\
**Last updated:** [January 22, 2020, 8:58pm UTC](https://forum.elixirforum.com/t/please-how-do-you-validate-url-inputs-in-your-phoenix-projects-forms/28268 "2020-01-22T20:58:28Z")

</div>

I’m looking for a way to validate any url, but also a specific one (for example youtube channel, facebook page like urls). Any recommended or common way of doing that? Ecto Type library? Thanks

---

## [Validation - library with +25 fully tested rules. +40 coming up soon!](https://forum.elixirforum.com/t/validation-library-with-25-fully-tested-rules-40-coming-up-soon/25423)

<div class="topic-metadata">

**Author:** [@matheusgontijo](https://forum.elixirforum.com/u/matheusgontijo)\
**Replies:** 1\
**Last updated:** [September 16, 2019, 12:16pm UTC](https://forum.elixirforum.com/t/validation-library-with-25-fully-tested-rules-40-coming-up-soon/25423 "2019-09-16T12:16:05Z")

</div>

Hey dear #AlchemistFriends! I’m creating a :check\_mark::check\_mark: validation engine :check\_mark::check\_mark:, in order to put several day-to-day validation rules all together!!! If you folks could take a look real qui…

---

## [Ensuring user input isn't too large?](https://forum.elixirforum.com/t/ensuring-user-input-isnt-too-large/22737)

<div class="topic-metadata">

**Author:** [@chanon](https://forum.elixirforum.com/u/chanon)\
**Replies:** 13\
**Last updated:** [May 30, 2019, 4:05am UTC](https://forum.elixirforum.com/t/ensuring-user-input-isnt-too-large/22737 "2019-05-30T04:05:35Z")

</div>

I am using phoenix for websocket and http communication with clients. Users can submit json messages which Phoenix converts to Elixir maps for me. How can I easily and quickly check for and reject requests that are ext…

---

## [Phoenix LiveView has odd behavior with select tags](https://forum.elixirforum.com/t/phoenix-liveview-has-odd-behavior-with-select-tags/21460)

<div class="topic-metadata">

**Author:** [@DavidVII](https://forum.elixirforum.com/u/DavidVII)\
**Replies:** 2\
**Last updated:** [April 9, 2019, 1:55am UTC](https://forum.elixirforum.com/t/phoenix-liveview-has-odd-behavior-with-select-tags/21460 "2019-04-09T01:55:10Z")

</div>

I have a form with a select tag which ties to the template\_id. If a template\_id is selected, I want to update the view to show some additional content. This content changes based on the template\_id that was selected. No…

---

## [Input validation confusion!](https://forum.elixirforum.com/t/input-validation-confusion/20520)

<div class="topic-metadata">

**Author:** [@MassiveFermion](https://forum.elixirforum.com/u/MassiveFermion)\
**Replies:** 6\
**Last updated:** [March 1, 2019, 6:29am UTC](https://forum.elixirforum.com/t/input-validation-confusion/20520 "2019-03-01T06:29:49Z")

</div>

I’ve just written the module below just as a practice. It converts numbers between different bases. But there is a problem. When converting from a non-decimal basis, the user can give a number with a digit that is greate…
