htmx icon indicating copy to clipboard operation
htmx copied to clipboard

Prompt default value

Open r3sist opened this issue 4 years ago • 1 comments

Dear 1cg, dear developers,

As a feature request, is it possible in the future to add to hx-prompt an optional default value? It would be useful :)

  • https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt

Thank you

r3sist avatar Sep 23 '21 12:09 r3sist

Hey everyone. I realise it's getting on for three years since this suggestion was made, but I believe this suggestion has legs: it would be incredibly useful to be able to pre-populate a prompt when it is shown, rather than just having an empty text field.

I know there's other options, such as SweetAlert2, or putting a form inside a Bootstrap modal, but I am trying to keep complexity to a minimum in a project I am working on.

vaughany avatar Jun 14 '24 15:06 vaughany

I wanted this too, so I added an attribute hx-prompt-default (literally a two line change lol). Hope it gets approved or maybe just helped someone!

maekoos avatar Jan 10 '25 11:01 maekoos