getgrav / getgrav/grav-plugin-form
Clarification needed on ambiguous docs "How to: Ajax Submission"
- Dominant language
- PHP
- Stars
- 64
- Forks
- 80
- Avg merge
- 10h 13m
- Merged PRs (30d)
- 9
Description
I would like some clarification on some ambiguous statements on [How to: Ajax Submission](https://learn.getgrav.org/16/forms/forms/how-to-ajax-submission)
Some quotes containing ambiguity:
> First, we'll create a form in a page called: forms/ajax-test/ and create a form page called form.md
Does it mean to create one or two form.md files? One empty (dummy?) `/forms/ajax-test/form.md` and the real form where I want my form to be reached e.g. `/03.contact/form.md`, or `/01.home/_contact/form.md`?
It also strikes me as a bit odd to create a 'real' form that doesn't show up in the menu. If it's merely a dummy it makes sense, but of course it may be referenced by some link in a page...
> NOTE: We use a hard-coded `action: '/forms/ajax-test'` so the ajax has a consistent URL rather than the letting the form set the action to the current page route.
This suggest there need to be two pages:
1) "the current page route" (e.g. `/01.home/_contact/form.md`)
2) and "a consistent URL" (the dummy) `/forms/ajax-test/form.md`
> NOTE: . . . It doesn't have to be the current form page, it just needs to be a consistent, reachable route.
Again this hints to a second page, to prevent *"This can otherwise cause issues on the 'home' page."*
So, after reading it over and over, I created two pages: 1) `/01.home/_contact/form.md` containing `action: /forms/ajax-test` and 2) an empty `/forms/ajax-test/form.md` . And guess what? It works fine...
However it also works fine if I only create one form `/01.home/_contact/form.md` containing `action: /home` (or '/'). But now I'm not sure if I may run into the issue: *"This can otherwise cause issues on the 'home' page."*
Please clarify which of the two approaches to use.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the linked “How to: Ajax Submission” page and the two example routes described in the issue. Determine what the documentation should say about the number of form.md files and the action route, then update the page so the supported setup and expected behavior are unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100