TIF_E41201448/application/views/dist/data_view.php

49 lines
1.3 KiB
PHP

<!DOCTYPE html>
<html>
<head>
<title>Contoh Popup Form CodeIgniter 3</title>
<style>
.popup {
display: none;
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 400px;
padding: 20px;
background-color: #f1f1f1;
border: 1px solid #ccc;
}
</style>
</head>
<body>
<h2>Contoh Popup Form CodeIgniter 3</h2>
<button onclick="openPopup()">Buka Popup Form</button>
<div id="popupForm" class="popup">
<h3>Popup Form</h3>
<form method="POST" action="<?php echo base_url('index.php/form-controller/submitForm'); ?>">
<label for="name">Nama:</label>
<input type="text" id="name" name="name" required><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required><br>
<button type="submit">Submit</button>
<button type="button" onclick="closePopup()">Tutup</button>
</form>
</div>
<script>
function openPopup() {
document.getElementById("popupForm").style.display = "block";
}
function closePopup() {
document.getElementById("popupForm").style.display = "none";
}
</script>
</body>
</html>