Forem

Matt Layman
Matt Layman

Posted on • Originally published at mattlayman.com

Create A Form Template - Building SaaS #78

In this episode, I created a template for one of my new forms on the new social media app that I'm building. We talked about context data, template styling, and special considerations for forms in templates.

I had an empty template for the invite sending form to begin.

I filled in a first attempt at the template with a header and displaying form errors. While building that, I added some context information that was needed for the display.

Since this is a new app, I created new styles that didn't exist yet. We needed a disabled button style for the scenario when the user can't send an invite.

After styling things, I added the hidden form data that the Django view expected to receive before sending an invite to another user.

Once the form was functional, we updated the template to include informational copy to make the page more understandable. In the process of adding that copy, I added some dynamic data to show how many remaining connections the user had available.

I put this new data on the User model and wrote some tests for this.

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay