Bank IFSC Code Checker
Bank IFSC Code Checker
Bank Information
Bank Name:
Branch:
Address:
Contact Number:
Invalid IFSC Code! Please try again.
/* General reset and body styling */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
background: #f0f8ff;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.container {
background: #fff;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
padding: 30px;
width: 300px;
text-align: center;
}
h1 {
color: #4CAF50;
margin-bottom: 20px;
}
input {
width: 80%;
padding: 10px;
margin-bottom: 10px;
border-radius: 5px;
border: 1px solid #ccc;
font-size: 16px;
}
button {
width: 85%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
.result {
margin-top: 20px;
padding: 10px;
background-color: #d4edda;
border: 1px solid #c3e6cb;
border-radius: 5px;
}
.hidden {
display: none;
}
#errorMessage {
color: #dc3545;
font-weight: bold;
}
document.getElementById('ifscForm').addEventListener('submit', function(event) {
event.preventDefault(); // Prevent form submission
const ifscCode = document.getElementById('ifscCode').value.trim().toUpperCase();
// Clear previous results and error message
document.getElementById('result').classList.add('hidden');
document.getElementById('errorMessage').classList.add('hidden');
// Check if the IFSC code entered is valid
if (ifscCode.length !== 11 || !/^[A-Za-z]{4}\d{7}$/.test(ifscCode)) {
document.getElementById('errorMessage').classList.remove('hidden');
return;
}
fetch(`https://ifsc.razorpay.com/${ifscCode}`)
.then(response => response.json())
.then(data => {
if (data.BANK) {
document.getElementById('bankName').textContent = data.BANK;
document.getElementById('branch').textContent = data.BRANCH;
document.getElementById('address').textContent = data.ADDRESS || 'N/A';
document.getElementById('contact').textContent = data.CONTACT || 'N/A';
// Display the result
document.getElementById('result').classList.remove('hidden');
} else {
// Handle invalid IFSC code response
document.getElementById('errorMessage').classList.remove('hidden');
}
})
.catch(error => {
document.getElementById('errorMessage').textContent = 'Error fetching data. Try again later.';
document.getElementById('errorMessage').classList.remove('hidden');
});
});