hi. i cant show the “click” events out put on div with “txt” name.whats the problem?
defmodule ViraquranWeb.Reqpage do
use Phoenix.LiveView
import SweetXml
def render(assigns) do
~L"""
<h1 class="block m-auto text-3xl text-center mt-6">جستجوی آیه</h1>
<form phx-submit="click" phx-hook="ViraquranWeb.Reqpage">
<label for="sur" class="text-center mt-20 block m-auto">سوره</label>
<input type="number" name="sur" class="w-32 block m-auto mt-6">
<label for="aye" class="text-center mt-20 block m-auto">آیه</label>
<input type="number" name="aye" class="w-32 block m-auto mt-6">
<input type="submit" class="block m-auto mt-8 bg-green-500 p-7 rounded-xl text-white" value="جستجو">
</form>
<div name="txt" class="w-1/2 rounded-xl h-40 bg-green-200 block m-auto mt-10" phx-value-text="txt">
<%= @txt %>
</div>
"""
end
def handle_event("click", %{"sur" => s, "aye" => a}, socket) do
ay = elem(Integer.parse(a), 0)
su = elem(Integer.parse(s), 0)
{:ok, xmldoc} = File.read("A:/WORK/virazh/bot/tbot/viraquran/lib/viraquran_web/live/quran-uthmani.xml")
ui = xmldoc |> xpath(~x"//sura[@index=\"#{su}\"]/aya[@index=\"#{ay}\"]/@text")
IO.puts(ui)
socket = assign(socket, :txt, ui)
{:noreply, socket}
end
end






















