Here's a simple example of a web page that accepts form inputs for a Root Cause Analysis (RCA) document. This is an HTML-based form with basic styling and optional JavaScript validation to collect the necessary details.
✅ Features:
- Form fields for RCA components like problem description, timeline, contributing factors, root cause, corrective actions, etc.
- Basic responsive layout using CSS
- Optional JavaScript validation
🌐 Root Cause Analysis Web Form
💻 Code: index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Root Cause Analysis Form</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 40px;
background-color: #f9f9f9;
}
h1 {
text-align: center;
color: #333;
}
form {
max-width: 800px;
margin: auto;
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
label {
display: block;
margin-top: 15px;
font-weight: bold;
}
input[type="text"],
textarea,
select {
width: 100%;
padding: 10px;
margin-top: 5px;
border-radius: 4px;
border: 1px solid #ccc;
resize: vertical;
}
textarea {
height: 100px;
}
button {
margin-top: 20px;
padding: 10px 20px;
background-color: #007BFF;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
.success-message {
display: none;
margin-top: 20px;
padding: 15px;
background-color: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
border-radius: 4px;
}
</style>
</head>
<body>
<h1>Root Cause Analysis Form</h1>
<form id="rcaForm" onsubmit="return validateForm()">
<label for="problem">Problem Description:</label>
<textarea id="problem" name="problem" required></textarea>
<label for="incidentDate">Incident Date & Time:</label>
<input type="datetime-local" id="incidentDate" name="incidentDate" required>
<label for="reportedBy">Reported By:</label>
<input type="text" id="reportedBy" name="reportedBy" required>
<label for="location">Location / System Affected:</label>
<input type="text" id="location" name="location" required>
<label for="impact">Impact of the Problem:</label>
<textarea id="impact" name="impact"></textarea>
<label for="contributingFactors">Contributing Factors:</label>
<textarea id="contributingFactors" name="contributingFactors"></textarea>
<label for="rootCause">Identified Root Cause:</label>
<textarea id="rootCause" name="rootCause"></textarea>
<label for="correctiveActions">Corrective Actions Taken:</label>
<textarea id="correctiveActions" name="correctiveActions"></textarea>
<label for="preventionPlan">Preventative Measures:</label>
<textarea id="preventionPlan" name="preventionPlan"></textarea>
<label for="status">Status:</label>
<select id="status" name="status" required>
<option value="">-- Select Status --</option>
<option value="Open">Open</option>
<option value="In Progress">In Progress</option>
<option value="Closed">Closed</option>
</select>
<button type="submit">Submit RCA</button>
</form>
<div class="success-message" id="successMessage">
✅ Your Root Cause Analysis has been submitted successfully!
</div>
<script>
function validateForm() {
const problem = document.getElementById("problem").value.trim();
const incidentDate = document.getElementById("incidentDate").value;
const reportedBy = document.getElementById("reportedBy").value.trim();
const status = document.getElementById("status").value;
if (!problem || !incidentDate || !reportedBy || !status) {
alert("Please fill in all required fields.");
return false;
}
// Show success message
document.getElementById("successMessage").style.display = "block";
// Optionally reset form or send data via AJAX here
return false; // Prevent actual form submission for demo
}
</script>
</body>
</html>
📝 How to Use:
- Copy the code above into a file named
index.html.
- Open it in any modern web browser.
- Fill out the form and submit — you'll see a success message appear without reloading the page.
🔧 Optional Enhancements:
- Add backend support (PHP, Node.js, Python Flask/Django) to store submissions.
- Export form data as PDF using libraries like jsPDF.
- Connect to a database or spreadsheet for persistent storage.
Let me know if you'd like help adding any of those features!