Enquiry form widget
window.MedosEnquiry — a contact form that files an enquiry against your Medos workspace instead of landing in an inbox.
The enquiry form is for the visitor who isn't ready to book. It takes their details and a message, and files the enquiry against your workspace where staff can respond to it — no mail server, no form backend, no spam bucket.
<script src="https://widgets.medos.one/v2/enquiries.js"></script>
<div id="medos-enquiry"></div>
<script>
MedosEnquiry.init({
apiKey: "mk_your_publishable_key",
mode: "inline",
containerId: "medos-enquiry",
onSuccess: (enquiry) => console.log("Enquiry filed", enquiry.inquirySubject),
});
</script>The bundle is self-contained and exposes one global, window.MedosEnquiry.
Install › CDN covers deferring the tag
and loading it on demand.
What the patient fills in
A single screen, then a confirmation screen. Every field is validated inline before the form will submit.
| Field | Notes |
|---|---|
| Full name | Required. |
| Email address | Required, format-checked. |
| Country code + phone | Required. The code is picked from a list. |
| Subject | Required. What the enquiry is about. |
| Message | Required. The enquiry body. |
| Preferred contact method | PHONE, EMAIL, or BOTH. |
There is no OTP step — an enquiry isn't a booking, so the contact details are taken at face value and confirmed by whoever follows up.
Try it
Configure it below and copy the snippet. The colour and font controls emit a nested theme object; the flat shortcuts such as primaryColor work too.
Enquiry form
A contact form that files an enquiry against your workspace. Theme object only.
window.MedosEnquiry
Custom theme
This widget takes a PartialTheme object rather than a theme name or the flat primaryColor shortcuts, so these controls are emitted as a nested theme.
View
Sizes the preview frame only. This widget takes no maxHeight, so the value never reaches the snippet.
<div id="medos-enquiry" style="min-height: 600px"></div>
<script src="https://widgets.medos.one/v2/enquiries.js"></script>
<script>
MedosEnquiry.init({
apiKey: "mk_your_publishable_key",
mode: "inline",
containerId: "medos-enquiry",
onSuccess: (enquiry) => console.log("Enquiry filed", enquiry),
onError: (err) => console.error(err),
});
</script>The `onSuccess` payload is personal data
Name, email, and phone all reach your handler — this callback fires with what the patient typed, not with a server-assigned id. Don't forward it to analytics; push an event without the fields. See the PII note in Analytics recipes.
Open it from a "Contact us" button
init({ mode: "modal" }) opens the modal straight away, so don't call it on
page load. The enquiry widget's open() can be the first call: pass the config
to it from the click handler.
<script defer src="https://widgets.medos.one/v2/enquiries.js"></script>
<button id="contact-btn">Contact us</button>
<script>
document.getElementById("contact-btn").onclick = () =>
MedosEnquiry.open({
apiKey: "mk_your_publishable_key",
onSuccess: () => {
window.dataLayer?.push({ event: "medos_enquiry_submitted" });
},
});
</script>The modal closes itself 3 seconds after a successful submission, which fires
onClose just as a manual dismissal would.
In this section
Patient portal errors
How MedosPatientPortal reports failures — config mistakes that throw, start-up failures that reach onError, and in-flow errors it handles itself.
Configure the enquiry form
Every MedosEnquiry option with its type and default, the init, open and close methods, and the MedosEnquiryConfig TypeScript type.