djaouen

djaouen

LiveView: Form Errors Not Showing Up

Hello,

I am trying to figure out why my LiveView forms aren’t displaying errors. It looks like they are being set in the appropriate handle_event callback, but they are nowhere to be seen despite being printed in my templates. :man_shrugging:

You can find my code here: GitHub - danieljaouen/phoenix_modal_example · GitHub

With the most relevant code being located in lib/modal_example_web/live/modal_example_live.ex and lib/modal_example_web/live/modal_example_live.html.heex.

Any help is greatly appreciated. Thanks!

Marked As Solved

codeanpeace

codeanpeace

https://github.com/danieljaouen/phoenix_modal_example/blob/ab4055dff623e386f5565450a7c121fda0c12152/lib/modal_example_web/live/modal_example_live.html.heex#L14-L19

Try removing phx-update="ignore" from the modal divs that wrap your forms.

  • ignore - ignores updates to the DOM regardless of new content changes

    The “ignore” behaviour is frequently used when you need to integrate with another JS library. Note only the element contents are ignored, its attributes can still be updated.

source: https://hexdocs.pm/phoenix_live_view/dom-patching.html

Last Post!

djaouen

djaouen

Yep, that did the trick. Thanks, @codeanpeace!!

Where Next?

Popular in Questions Top

hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New