Node Js React Js Django
Node Js React Js Django
Node js/ React js/ Django (Jawaharlal Nehru Technological University, Anantapur)
1
Md. R. A. B
2
Md. R. A. B
3
Md. R. A. B
AIM: Make the above web application responsive web application using Bootstrap framework
DESCRIPTION:
Bootstrap is a popular CSS framework that makes it easy to create responsive web applications.
The previous example can be modified using Bootstrap by following these steps:
Project Structure:
1. index.html - Main HTML file containing the structure of the web application with Bootstrap.
2. script.js - JavaScript file for handling interactions and logic (no changes from the previous
example).
3. styles.css - You can include additional custom styles if needed.
4. images/ - Folder for storing images.
index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet">
<!-- Custom CSS -->
<link rel="stylesheet" href="styles.css">
<title>Shopping Cart</title>
</head>
<body>
<header class="bg-dark text-white text-center py-3">
<h1>Shopping Cart</h1>
<nav>
<ul class="nav justify-content-center">
<li class="nav-item"><a class="nav-link" href="#catalog">Catalog</a></li>
<li class="nav-item"><a class="nav-link" href="#cart">Cart</a></li>
<li class="nav-item"><a class="nav-link" href="#login">Login</a></li>
<li class="nav-item"><a class="nav-link" href="#register">Register</a></li>
</ul>
</nav>
</header>
<main class="container mt-3" id="content">
<!-- Content will be loaded dynamically using JavaScript -->
</main>
<!-- Bootstrap JS (optional, for certain features) -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="script.js"></script>
</body>
</html>
4
Md. R. A. B
5
Md. R. A. B
AIM:
Use JavaScript for doing client – side validation of the pages implemented in experiment 1: Build a
responsive web application for shopping cart with registration, login, catalog and cart pages using
CSS3 features, flex and grid and experiment 2: Make the above web application responsive web
application using Bootstrap framework
DESCRIPTION:
To perform client-side validation using JavaScript, you can add scripts to validate user inputs on the
registration and login pages.
The modifications for both experiments are listed below.
Experiment 1: Responsive Web Application without Bootstrap
Add the following JavaScript code to script.js:
// Function to validate registration form
function validateRegistration() {
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
if (username.trim() === '' || password.trim() === '') {
alert('Please enter both username and password.');
return false;
}
// Additional validation logic can be added as needed
return true;
}
// Function to validate login form
function validateLogin() {
const username = document.getElementById('loginUsername').value;
const password = document.getElementById('loginPassword').value;
if (username.trim() === '' || password.trim() === '') {
alert('Please enter both username and password.');
return false;
}
// Additional validation logic can be added as needed
return true;
}
Modify the HTML login and registration forms:
<!-- Registration Form -->
<form onsubmit="return validateRegistration()">
<!-- ... existing form fields ... -->
<button type="submit">Register</button>
</form>
<!-- Login Form -->
<form onsubmit="return validateLogin()">
<!-- ... existing form fields ... -->
<button type="submit">Login</button>
</form>
6
Md. R. A. B
7
Md. R. A. B
8
Md. R. A. B
9
Md. R. A. B
10
Md. R. A. B
11
Md. R. A. B
12
Md. R. A. B
13
Md. R. A. B
14
Md. R. A. B
15
Md. R. A. B
16
Md. R. A. B
17
Md. R. A. B
18
Md. R. A. B
19
Md. R. A. B
20
Md. R. A. B
21
Md. R. A. B
22
Md. R. A. B
23
Md. R. A. B
24
Md. R. A. B
25
Md. R. A. B
26
Md. R. A. B
27
Md. R. A. B
28
Md. R. A. B
29
Md. R. A. B
30
Md. R. A. B
31
Md. R. A. B
32
Md. R. A. B
33
Md. R. A. B
34
Md. R. A. B
14. Create a TODO application in react with necessary components and deploy it into github
35
Md. R. A. B
36
Md. R. A. B
37
Md. R. A. B