Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting value from changeset to display number only in input #215

Open
SamuelMTDavies opened this issue Jan 30, 2024 · 1 comment
Open

Comments

@SamuelMTDavies
Copy link

I have an issue where a user inputs a value into a numerical input. If an issue occurs further down the call chain and the changeset is not valid the numerical input then displays the value with the currency symbol.

Is there a way to extract and display the value only?

<.input field={f[:amount]} type="donation" required />

Input before changeset:
Screenshot 2024-01-30 at 14 05 06

Input if another input causes invalid changeset and page is re-rendered:

Screenshot 2024-01-30 at 14 05 20

How do I ensure the amount is extracted from the changeset when this happens? Because this way if the form was submitted again would then cause an error on the amount input now because of the symbol.

@lessless
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants