Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor HTML issue in www/content/examples/click-to-edit.md #3156

Open
gbmerrall opened this issue Jan 29, 2025 · 3 comments
Open

Minor HTML issue in www/content/examples/click-to-edit.md #3156

gbmerrall opened this issue Jan 29, 2025 · 3 comments

Comments

@gbmerrall
Copy link

The example form in click-to-edit should probably have the type="submit" paramter added to the submit button so the form action can get fired.

Bit too small for its own pull request so if someone is working on docs they could include this change.

<form hx-put="/contact/1" hx-target="this" hx-swap="outerHTML">
  <div>
    <label>First Name</label>
    <input type="text" name="firstName" value="Joe">
  </div>
  <div class="form-group">
    <label>Last Name</label>
    <input type="text" name="lastName" value="Blow">
  </div>
  <div class="form-group">
    <label>Email Address</label>
    <input type="email" name="email" value="[email protected]">
  </div>
  <button ---> type="submit" <----  class="btn">Submit</button>
  <button class="btn" hx-get="/contact/1">Cancel</button>
</form>
@geoffrey-eisenbarth
Copy link
Contributor

geoffrey-eisenbarth commented Jan 29, 2025

The default action of a button is to submit its associated form, so this shouldn't be necessary. Are you having issues when it's not explicitly specified to be type=submit?

@gbmerrall
Copy link
Author

Yes. I'll make a reproduceable case. In doing so it may likely uncover a PEBKAC error.

@geoffrey-eisenbarth
Copy link
Contributor

Please let us know the results either way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants