Beautiful, modern, accessible, and customizable form templates for Dynamics 365 Customer Insights - available in both Tailwind CSS and pure CSS3 versions.
This repository provides custom HTML form templates for Dynamics 365 Customer Insights that break free from the standard default forms. These templates are rebuilt from the ground up with a modern look, advanced features, and full accessibility support.
This repo was inspired by the work of Megan V. Walker, who’s content I’ve used over the years to super-charge my Dynamics knowledge. https://meganvwalker.com
Dynamics 365 has multiple form types: standard forms (such as contact forms), event forms, and preference centers. This repo currently focuses on standard forms, with event forms and preference centers coming soon.
This repository includes two versions of the contact form template:
contact-form.html)contact-form-css3.html)📊 Need help choosing? See the Template Comparison Guide for detailed differences and recommendations.
Note: Both versions use Google Fonts and an optional email validation API. The validation API fails gracefully if unavailable.
One template, infinite possibilities! Simply change a single color value to switch themes.
| Theme | Color Code | Description | Use Case |
|---|---|---|---|
| 🔵 Blue | #0078d4 |
Professional and trustworthy | Default, tech, corporate |
| ⚫ Corporate | #1e293b |
Sleek slate gray | B2B, enterprise, professional |
| 🟣 Vibrant | #9333ea |
Bold purple | Creative, events, youth brands |
| ⚪ Minimal | #000000 |
Classic black and white | Luxury, design studios, modern |
| 🎨 Custom | #?????? |
Your brand color | Anything you want! |
For Tailwind CSS Version:
templates/contact-form.html#0078d4 with your chosen color codeFor Pure CSS3 Version:
templates/contact-form-css3.html:root CSS variables section (around line 44)--brand-color: #0078d4; with your chosen color codeExample:
colors: {
brand: {
DEFAULT: /* @brand-color */ '#9333ea' /* @brand-color */
// Changed to Vibrant theme!
}
}
That’s it! The entire form (buttons, focus rings, checkboxes) automatically updates to your chosen color.
Before using these templates, ensure you have:
templates/contact-form.html (uses Tailwind CSS CDN)templates/contact-form-css3.html (no external frameworks)data-targetaudience attributes (contact or lead)data-targetproperty values match your CRM field logical namesFor detailed technical documentation, see documentation.md.
Change Colors:
The template includes clear instructions at the top of the file. Just change one line:
DEFAULT: /* @brand-color */ '#0078d4' /* @brand-color */
Replace #0078d4 with any hex color to instantly theme the entire form!
Customize Validation Messages:
Find the VALIDATION_CONFIG object in the template and modify the messages:
const VALIDATION_CONFIG = {
messages: {
required: 'Please fill out this field',
email: 'Please enter a valid email address',
emailPersonal: 'Work email is preferred. Personal email detected.',
emailInvalid: 'This email address is not valid',
emailValid: 'Email address accepted',
validating: 'Validating email...'
},
// Add or remove personal email domains
personalDomains: [
'gmail.com', 'yahoo.com', 'outlook.com', 'hotmail.com', ...
]
};
Add Custom Fields:
<div class="mb-4"
data-editorblocktype="TextFormField"
data-targetaudience="contact"
data-targetproperty="your_field_logical_name"
data-required="required">
<label for="your_field" class="block text-gray-800 text-sm font-medium mb-2">
Your Field Label
</label>
<input id="your_field"
type="text"
name="your_field_logical_name"
placeholder="Enter value"
required
title="Your custom validation message"
class="w-full p-3 border border-gray-300 rounded-lg">
<span class="validation-message text-sm text-red-600 mt-1 hidden"></span>
</div>
This project includes a comprehensive test suite to ensure all functionality works as expected.
# Install dependencies
npm install
# Run all tests (HTML validation + automated tests)
npm test
# Run only HTML validation
npm run test:html
# Run automated test suite
npm run test:serve
# Open browser-based interactive tests
npm run test:browser
The test suite includes 31+ automated tests covering:
For detailed testing documentation, see tests/README.md.
Form doesn’t submit:
data-targetaudience matches your target entity (contact or lead)data-targetproperty values match exact CRM field logical names<head>Validation messages not showing:
<span class="validation-message">) are presentinitFormValidation() function is runningEmail validation not working:
Styling doesn’t appear:
<head> sectionModal doesn’t close:
closeThankYouModal() JavaScript function is includedFields not mapping to CRM:
data-targetproperty attributes to match exactly (case-sensitive)Tests failing:
npm install to ensure all dependencies are installedtemplates/contact-form.html exists and is readableFor more detailed troubleshooting, see the documentation.
Contributions are welcome! If you’d like to improve these templates:
git checkout -b feature/your-feature)git commit -m 'Add your feature')git push origin feature/your-feature)Please ensure your code:
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or issues:
Made with ❤️ for the Dynamics 365 community