## EXP.NO: 05 Validating Web Form Controls using DHTML ### AIM To write a client-side script using JavaScript (DHTML) to validate a web form field and display validation messages beside the input field. ### ALGORITHM 1. Create an HTML document with the proper structure using ``, ``, ``, and `` elements. 2. Inside the `` section, create a `
` element with the name `contact_form`. 3. Inside the form, add: * A text input field with the name `contact_name`. * A placeholder element such as a `` with an id `msg` below the input field to display validation messages. * A submit button. 4. Inside the `` section, add a `

Please Enter Your Name

Your Name:

``` ### OUTPUT Case 1: Empty name field The message “Please fill in the name” is displayed beside the input field. Case 2: Name entered The message “Successful” is displayed beside the input field. ### RESULT The web form was successfully validated using JavaScript (DHTML), displaying appropriate validation messages based on the user input.