JSFiddle - React, Tailwind, and code Playground

by Alex Cowan

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>FDA MedWatch Reporting Form</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
        }

        form {
            max-width: 400px;
            margin: 0 auto;
        }

        label {
            display: block;
            margin-bottom: 8px;
        }

        input, textarea {
            width: 100%;
            padding: 8px;
            margin-bottom: 16px;
            box-sizing: border-box;
        }

        button {
            background-color: #4CAF50;
            color: white;
            padding: 10px 15px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }

        button:hover {
            background-color: #45a049;
        }

        #confirmation-message {
            display: none;
            margin-top: 20px;
            padding: 10px;
            background-color: #dff0d8;
            border: 1px solid #3c763d;
            color: #3c763d;
            border-radius: 5px;
        }
    </style>
</head>
<body>
    <form id="medwatch-form">
        <!-- Patient Name with Autocomplete Feature -->
        <label for="patient-name">Patient Name:</label>
        <input type="text" id="patient-name" name="patient-name" placeholder="Enter patient name" autocomplete="on" required>

        <!-- Email ID Input -->
        <label for="email">Email ID:</label>
        <input type="email" id="email" name="email" placeholder="Enter email address" required>

        <!-- Medicine Used Input -->
        <label for="medicine-used">Medicine Used:</label>
        <input type="text" id="medicine-used" name="medicine-used" placeholder="Enter medicine used" required>

        <!-- Symptoms Experienced with Free-Text Area -->
        <label for="symptoms">Symptoms Experienced:</label>
        <textarea id="symptoms" name="symptoms" placeholder="Describe the symptoms"...

CSS

body {
    font-family: Arial, sans-serif;
    margin: 20px;
}

form {
    max-width: 400px;
    margin: 0 auto;
}

label {
    display: block;
    margin-bottom: 8px;
}

input, textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: #45a049;
}

#confirmation-message {
    display: none;
    margin-top: 20px;
    padding: 10px;
    background-color: #dff0d8;
    border: 1px solid #3c763d;
    color: #3c763d;
    border-radius: 5px;
}

JavaScript

function submitForm() {
    // You can add additional validation or AJAX submission here
    document.getElementById('medwatch-form').style.display = 'none';
    document.getElementById('confirmation-message').style.display = 'block';
  }