wktdev
I used the Phoenix generator to create a table and the accompanying HTML forms.
The form inputs are input and I want to change one of them to textarea.
The form template the generator gives me is this:
<.simple_form :let={f} for={@changeset} action={@action}>
<.error :if={@changeset.action}>
Oops, something went wrong! Please check the errors below.
</.error>
<.input field={f[:name]} type="text" label="Name" />
<.input field={f[:version]} type="text" label="Version" />
<.input field={f[:owner]} type="text" label="Owner" />
<.input field={f[:note]} type="text" label="Note" />
<.input field={f[:developer]} type="text" label="Developer" />
<.input field={f[:status]} type="text" label="Status" />
<.input field={f[:url]} type="text" label="Url" />
<:actions>
<.button>Save Test bed</.button>
</:actions>
</.simple_form>
If I try to change one of those inputs to textarea I get an error. Example:
<.textarea field={f[:note]} type="text" label="Note" />
How do I change them without error?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 5- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
benwilson512
Hi @wktdev please always provide any errors that you get.
EDIT: Based on my read of the core components you should be doing:
wktdev
Thanks, and noted.
7stud
Can you direct me to where I can read about the core components? I can’t find anything about
<.input>. For instance, how are people supposed to know what the various possible values for thetypeattribute are? “textarea” is not a legaltypeattribute for an html input element, but it works with the input function.Also, is there something to create a datetime select, e.g.:
perhaps:
??
codeanpeace
Core components are defined in your application code so assuming you’re using the generators, take a look at the inline docs in your
core_components.exfile.https://github.com/phoenixframework/phoenix/blob/f549f935735feee9857df1e4753531754f3668d5/priv/templates/phx.gen.live/core_components.ex#L245-L390
Regarding support for
"textarea", it’s added via a custom functionhead:https://github.com/phoenixframework/phoenix/blob/f549f935735feee9857df1e4753531754f3668d5/priv/templates/phx.gen.live/core_components.ex#L349-L367
From a while back, here’s an example of extending the
.inputcore component to support radio buttons.7stud
Okay, I see “core components” mentioned everywhere, but there is nothing in the docs about them. In my Phoenix app, I just found the file:
auction_web/lib/auction_web/components/core_components.exThat’s where things like
<.simple_form>and<.input>come from.The Phoenix.Component docs should allow me to figure out how the functions in core_components.ex work.