Lab03 PDF
Lab03 PDF
Your need to write javascript code to validate the form’s information when user click the submit
button. When the submit button is clicked, the following conditions must be checked:
- All fields should be fulfilled.
- A valid email should is entered.
- Password must contain at least 6 characters.
The conditions must be validated in the order listed above. If one of the conditions is failed, you
should stop the validation and display the corresponding error message immediately. Here are
some examples of the error messages:
Exercise 2: Write javascript code to add new student to the end of the table. You should check the
input to avoid the user leaving a field blank. Display an appropriate error message when something
went wrong. If a user click on the delete button, the corresponding student will be removed from
the table.
Exercise 3: You are given a web page. Your task is to write javascript code for the web page
behaves like the image below.
When a user enters a message or changes text color or changes the text style, the text and style of
green alert box will be changed accordingly.
If the user click on “Restore Default” button, all input fields will be restored to their default value.
Exercise 4: Create a photo slide show site like the one shown below:
Requirements:
- By default, the site will display the first image in the list.
- When a user clicks on the Next or Back button, the corresponding image will be displayed.
- If a user clicks on the Next button when the last image is showing, the first image will be
displayed (and vice versa).
- If the user presses the Start slideshow button, the image will be changed automatically
after 1 second.
- If the web page is in slideshow mode, the Next, Back buttons will be disabled and the
"Start slideshow" button will be changed to "Stop slideshow".
- When the user presses the "Stop slideshow", the state of the buttons is back to the original.