Newer
Older
labs / tiddlers / content / labs / lab04 / _Labs_04_Adding a Student (HTML).md

The add-student.html page in the Web Pages folder is where we need to add the form that allows the user to enter the details for a student.

Add the following HTML to the <main> tag:

<h1>Add New Student</h1>

<fieldset>

    <legend>Student Details</legend>

    <form action="add-student" method="POST">
        <label>ID:</label><input type="text" name="id"/>
        <label>Name:</label><input type="text" name="name"/>
        <label>Address:</label><textarea name="address"></textarea>
        <button type="submit">Add Student</button>
    </form>

</fieldset>

<a class="nav" href="index.html">Back to Menu</a>

This contains a title heading and a form for the student's details. We are also adding a navigation link to the bottom of the page so that the user can get back to the menu.

Build and redeploy the application by copying the WAR file into the webapps folder again, replacing the original file.

Click the 'Add New Student' link in the index/menu page to view the form. It will look pretty ugly at the moment, but it should have all of the components to allow a user to enter the details for a student.