akil
December 29, 2021, 4:44pm
1
I’ve found that opening form is closed immediately without body between <.form> … </.form>
<.form let={f} for={:data} phx-change="validate" phx-submit="save" phx-target={@myself.cid} >
<%= label f, :name %>
<%= text_input f, :name %>
<%= error_tag f, :name %>
<%= submit "Save" %>
</.form>
Produces
<form action="#" method="post" id="service_formvvdfdf" phx-change="validate" phx-submit="save" phx-target="4"></form>
<label ....
<input ....
<button submit ....
So why form does not include all other tags before is closed ?
APB9785
December 29, 2021, 5:02pm
2
It looks like it’s showing all the tags… Except the error, which makes sense because the form hasn’t been validated yet.
akil
December 29, 2021, 6:01pm
3
I’ve updated first post…
It seems that it has been opened and closed immediately
<form ....> </form>
That confuses me, if I put same form in heex of another component, than I can submit whole form. However, if I edit HTML code inside browser and move < /form > after < button type=submit > I can submit data to server.
akil
December 29, 2021, 7:07pm
4
Found issue, show the modal must be in the correct place instead of separate div in the code.
1 Like