Question: SchoolMangmentSystem This week Task The existing code provaide the base code for managing students in the School Managment System your responsiblities are the following: Communicate

SchoolMangmentSystem

This week Task

The existing code provaide the base code for managing students in the School Managment System yourresponsiblities are the following:

  • Communicate and ask questions
  • Show list of added students in the web page
  • Allow the user to update a student from the list
  • Also, allow the user to delete a student from the list
  • Make the user interface easy to use, comfratble, and simple
  • Make your code clean as possbile, choose good varaibles and functions names

//index.html -->

School Managment System

//

main.js-->

var students = [];
document.getElementById('submit').addEventListener('click', () => {
let x = 20;
let nameInputEl = document.getElementById('name');
let idInputEl = document.getElementById('idNumber');
let gdpaInputEl = document.getElementById('gdpa');
// Validation for input
inputValidation(nameInputEl.value, idInputEl.value, gdpaInputEl.value);
// insert student
insertStudent(nameInputEl.value, idInputEl.value, gdpaInputEl.value);
// Show success message
showMessage('success');
students = null;
});
function inputValidation(name, id, gdpa) {
// check for the value of each element
let x = 30;
if (name == '') {
alert('Please insert the student name');
}
if (id == '') {
alert('Please insert the student id number');
}
if (gdpa == '') {
alert('Please insert the student gdpa');
}
}
function insertStudent(name, id, gdpa) {
let student = {
name: name,
id: id,
gdpa: gdpa,
};
students.push(student);
console.log('students array: ', students);
}
function showMessage(event){
if (event == 'success') {
alert('Studnet added!')
}else{
alert('Faild to add student')
}
}

//

// Show list of students
// Update student
// Delete student

//

settings.json-->

{

"colorWheel.settings.workspaceColor": "hsl(277,90%,35%)"
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To provide a more detailed answer follow these steps Step 1 Structuring HTML Elements Form Inputs Ensure each tag has unique IDs name idNumber gdpa an... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!