0% found this document useful (0 votes)
9 views2 pages

JavaScript Registration Documentation

This document outlines the integration of JavaScript in a Student Registration System using HTML and CSS. It details the purpose of JavaScript, including displaying a welcome message, preventing form submission, collecting user inputs, and logging them to the console. The JavaScript code provided enhances user experience while adhering to beginner-level coding practices.

Uploaded by

Ilam Deen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

JavaScript Registration Documentation

This document outlines the integration of JavaScript in a Student Registration System using HTML and CSS. It details the purpose of JavaScript, including displaying a welcome message, preventing form submission, collecting user inputs, and logging them to the console. The JavaScript code provided enhances user experience while adhering to beginner-level coding practices.

Uploaded by

Ilam Deen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

JavaScript Integration in Student

Registration Page
Introduction
This document explains the basic JavaScript integration in a simple HTML and CSS-based
Student Registration System. The purpose is to demonstrate the understanding of
JavaScript fundamentals like alert boxes, event handling, and console logging.

Purpose of JavaScript in the Project


The JavaScript code added in the registration page is meant to:
1. Show a welcome message when the page loads.
2. Prevent the default form submission.
3. Collect user inputs from the form.
4. Log the inputs into the browser console.
5. Display a confirmation message after submission.

JavaScript Code Explanation


The following JavaScript was added at the end of the <body> section:

<script>
alert("Welcome to the Registration Page!");

document.addEventListener("DOMContentLoaded", function () {
var form = document.getElementById("registrationForm");

form.addEventListener("submit", function (event) {


event.preventDefault();

var name = document.getElementById("fullName").value;


var email = document.getElementById("email").value;
var course = document.getElementById("course").value;

console.log("Name: " + name);


console.log("Email: " + email);
console.log("Course: " + course);

alert("Registration submitted successfully!");


});
});
</script>

Conclusion
This JavaScript addition follows beginner-level coding practices as introduced in class. It
enhances user experience by showing alerts and logging the data for testing purposes
without any advanced functionality.

You might also like