Skip to content

ITSSONAM-0/Server-Side-Validation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task2 Web Application

live link :- https://server-side-validation.onrender.com

A simple web application demonstrating complex HTML forms with client-side and server-side validation, and temporary data storage using MERN stack (Node.js/Express).

Features

  1. Complex HTML Form: Registration form with various input types (text, email, password, number, select, checkboxes).
  2. Client-side Validation: Inline JavaScript validates form fields before submission.
  3. Server-side Validation: Node.js/Express server validates data and checks for duplicates.
  4. Temporary Storage: Validated data is stored in server memory (resets on server restart).

Prerequisites

  • Node.js installed on your system
  • npm (comes with Node.js)

Installation

  1. Navigate to the project directory:

    cd c:\Users\pc\Desktop\task2
    
  2. Install dependencies:

    npm install
    

Running the Application

  1. Start the server:

    npm start
    
  2. Open your web browser and go to http://localhost:3000

Usage

  • Fill out the registration form with valid data.
  • Client-side validation will prevent submission if data is invalid.
  • Server-side validation provides additional checks and stores data.
  • View submitted data by visiting http://localhost:3000/data (for demonstration).

Form Fields

  • Full Name: At least 2 characters
  • Email: Valid email format
  • Password: At least 6 characters
  • Confirm Password: Must match password
  • Age: Between 18 and 120
  • Gender: Select from options
  • Interests: Select at least one checkbox

Troubleshooting

  • Port 3000 already in use: Change the PORT variable in server.js to a different number.
  • Node.js not found: Install Node.js from https://nodejs.org/
  • Dependencies not installing: Ensure you have internet connection and try npm install again.
  • Form not submitting: Check browser console for JavaScript errors.
  • Server errors: Check terminal/console output for error messages.

Data Storage

Data is stored temporarily in server memory. It will be lost when the server restarts. For persistent storage, consider using a database like MongoDB or SQLite.

About

Objective: Expand inline styles and introduce server- side validation for form submissions. Steps: 1.Extend HTML with more complex forms and user interactions. 2.Utilize inline JavaScript for client-side form validation. 3.Implement server-side validation for submitted form data. 4.Store validated data in temporary server-side storage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors