Is it possible to use custom HTML for form plugin with input confirmation screen?

Sorry for asking–I searched everywhere but I still can’t find a solution to what I need to do.

Basically, I already have an HTML form ready for use as a contact page. It doesn’t need Ajax validation and stuff. On submit, it just needs to validate the data, if there are errors, list the error together with the contact page (with the inputted values already showing and ready to be edited). If it’s okay, show a confirmation page listing everything the user typed, with a final “Submit” button below (also using custom HTML). If clicked, it will actually send the email and show a “Thanks” screen (also using custom HTML).

The problem is, the HTML form layout is pretty unique, and is impossible to recreate using just YAML on the header frontmatter. That’s why I need to use my HTML with as little modification as possible. I don’t need the form to be customizable with the Admin. It can be a hard-coded HTML form (and I’d prefer it to be that way). Also, I need a “confirmation” page, which Grav Forms doesn’t provide, as far as I know.

My last resort will be to create a custom plugin (hopefully, that does fix my problem–if it doesn’t, then I’m really screwed.) but if I can avoid creating a custom plugin, that’d be really great as I don’t really have the time to learn the Grav API (and brush up my PHP skills).

Is there any method I can take to achieve this? If I need to write my own plugin, then I guess I have no choice. Really sorry, I looked everywhere but I can’t find an answer. I’m just desperate. Thanks in advance!

Did you already have a closer look at the twig templates that come with the grav form plugin ?
(these templates offer a high degree of flexibility, far beyond what you can do just with frontmatter).
And, of coures, welcome to grav :slight_smile:

Thanks for the reply!

Unfortunately, yes, I did, but I’m sorry to say that I don’t really understand it. It doesn’t seem to offer the possibility to show a “confirmation” page, and it seems to offer too much (that I don’t understand how to customize it) when all I need is really simple–to use an actual HTML form as the template itself.

Is there a possibility for me to use the HTML form itself as the template with minimal HTML tweaking? (I can edit HTML–it’s just the Form plugin that I can’t wrap my head around).

Sorry for being annoying.

Also, thanks for the warm welcome! I find Grav vastly superior compared to other CMS, and I want to use it for all my CMS needs even in future projects. I really love the blueprints feature, it’s just the Form plugin that I can’t really figure out–all I want is to use my premade HTML, and not render the form from the frontmatter YAML at all…

Well, Im currently not able to look in the form plugin code, So I can just give some hints: It is really woth to dive deeper in the functionality of twig. Basically, you have everything at hand waht you normally use with html, such as divs, paragraphs, classes and so on.
But, as a BIG addition: all the ineternal variables that grav or your plugin uses.
So, much easier to achieve what you want than with plain html !
I would recommend to take the templates from the forms plugin to learn twig and then figure out what you don`t need and eventually add things that are not available.
Good luck.


I’ll quote Ricardo on a similar question on the discord channel

All you need is name=“data[variablename]”
if the variable name matches the then it will submit

So, you need to add the name="data[variablename]" in your form and it should do the trick.