Index: Prototype Application/Paw5/src/main/java/finki/paw5/service/PetService.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/service/PetService.java	(revision 8f1a3629012fe6643a57cff9c48d555b9c8a876f)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/service/PetService.java	(revision f194b4e2c295711f91f334d8423d00594a877bac)
@@ -10,3 +10,5 @@
 
     List<Pet> listpets();
+
+    Pet findById(Integer id);
 }
Index: Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PetServiceImplementation.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PetServiceImplementation.java	(revision 8f1a3629012fe6643a57cff9c48d555b9c8a876f)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PetServiceImplementation.java	(revision f194b4e2c295711f91f334d8423d00594a877bac)
@@ -24,3 +24,8 @@
     @Override
     public List<Pet> listpets() {return this.petRepository.findAll();}
+
+    @Override
+    public Pet findById(Integer id) {
+        return this.petRepository.findById(id).get();
+    }
 }
Index: Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PostController.java
===================================================================
--- Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PostController.java	(revision 8f1a3629012fe6643a57cff9c48d555b9c8a876f)
+++ Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/PostController.java	(revision f194b4e2c295711f91f334d8423d00594a877bac)
@@ -38,9 +38,11 @@
 
     @PostMapping("/submit-post")
-    public String savePost(@RequestParam(required = false) String name,
-                           @RequestParam String gender,
-                           @RequestParam String ageGroup,
-                           @RequestParam String size,
-                           @RequestParam String species,
+    public String savePost(@RequestParam(required = false) Integer petId,
+                           @RequestParam(required = false) boolean newPetCheckbox,
+                           @RequestParam(required = false) String name,
+                           @RequestParam(required = false) String gender,
+                           @RequestParam(required = false) String ageGroup,
+                           @RequestParam(required = false) String size,
+                           @RequestParam(required = false) String species,
                            @RequestParam(required = false) String breed,
                            @RequestParam(required = false) String imageUrl,
@@ -50,9 +52,20 @@
         Employee employee = (Employee) request.getSession().getAttribute("user");
 
-        Pet pet = new Pet(imageUrl, AgeGroup.valueOf(ageGroup), Size.valueOf(size), breed, name, Species.valueOf(species), Gender.valueOf(gender), canBeFostered, null, employee.getShelterId());
-        this.petService.save(pet);
+        if(newPetCheckbox == true){
 
-        Post post = new Post(LocalDate.now(), imageUrl, pet.getId(), null, employee.getId());
-        this.postService.save(post);
+            Pet newPet = new Pet(imageUrl, AgeGroup.valueOf(ageGroup), Size.valueOf(size), breed, name, Species.valueOf(species), Gender.valueOf(gender), canBeFostered, null, employee.getShelterId());
+            this.petService.save(newPet);
+
+            Post post = new Post(LocalDate.now(), imageUrl, newPet.getId(), null, employee.getId());
+            this.postService.save(post);
+
+        } else{
+
+            Pet selectedPet = this.petService.findById(petId);
+
+            Post post = new Post(LocalDate.now(), imageUrl, selectedPet.getId(), null, employee.getId());
+            this.postService.save(post);
+
+        }
 
         return "redirect:/home";
Index: Prototype Application/Paw5/src/main/resources/templates/create-post.html
===================================================================
--- Prototype Application/Paw5/src/main/resources/templates/create-post.html	(revision 8f1a3629012fe6643a57cff9c48d555b9c8a876f)
+++ Prototype Application/Paw5/src/main/resources/templates/create-post.html	(revision f194b4e2c295711f91f334d8423d00594a877bac)
@@ -11,4 +11,35 @@
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+    <script>
+        function addNewPet(addNewPetCheckBox){
+
+            if(addNewPetCheckBox.checked){
+
+                document.getElementById("name").disabled = false;
+                document.getElementById("gender").disabled = false;
+                document.getElementById("ageGroup").disabled = false;
+                document.getElementById("size").disabled = false;
+                document.getElementById("species").disabled = false;
+                document.getElementById("breed").disabled = false;
+                document.getElementById("imageUrl").disabled = false;
+                document.getElementById("canBeFostered").disabled = false;
+
+                document.getElementById("petId").disabled = true;
+            } else{
+
+                document.getElementById("name").disabled = true;
+                document.getElementById("gender").disabled = true;
+                document.getElementById("ageGroup").disabled = true;
+                document.getElementById("size").disabled = true;
+                document.getElementById("species").disabled = true;
+                document.getElementById("breed").disabled = true;
+                document.getElementById("imageUrl").disabled = true;
+                document.getElementById("canBeFostered").disabled = true;
+
+                document.getElementById("petId").disabled = false;
+
+            }
+        }
+    </script>
 </head>
 <body>
@@ -42,9 +73,10 @@
 
     <div>
-        <label for="pet">Select pet:</label>
-        <select id="pet">
+        <label for="petId">Select pet:</label>
+        <select id="petId" name="petId">
             <option
             th:each="pet :${pets}"
-            th:text="${pet.getName()}">
+            th:text="${pet.getName()}"
+            th:value="${pet.getId()}">
             </option>
         </select>
@@ -52,6 +84,6 @@
 
     <div>
-        <label for="newpet">Add new pet:</label>
-            <input id="newpet" name="newpet" placeholder="newpet" type="checkbox">
+        <label for="newPetCheckbox">Add new pet:</label>
+            <input id="newPetCheckbox" name="newPetCheckbox" type="checkbox" onclick="addNewPet(this)">
     </div>
 
@@ -62,5 +94,6 @@
                name="name"
                class="form-control"
-               placeholder="Enter name">
+               placeholder="Enter name"
+               disabled>
     </div>
 
@@ -69,5 +102,6 @@
         <select id="gender"
                 name="gender"
-                class="form-control">
+                class="form-control"
+                disabled>
             <option value = "MALE">male</option>
             <option value = "FEMALE">female</option>
@@ -79,5 +113,6 @@
         <select id="ageGroup"
                 name="ageGroup"
-                class="form-control">
+                class="form-control"
+                disabled>
             <option value = "YOUNG">young</option>
             <option value = "ADULT">adult</option>
@@ -90,5 +125,6 @@
         <select id="size"
                 name="size"
-                class="form-control">
+                class="form-control"
+                disabled>
             <option value = "XSMALL">extra small</option>
             <option value = "SMALL">small</option>
@@ -103,5 +139,6 @@
         <select id="species"
                 name="species"
-                class="form-control">
+                class="form-control"
+                disabled>
             <option value = "CAT">cat</option>
             <option value = "DOG">dog</option>
@@ -116,5 +153,6 @@
                name="breed"
                class="form-control"
-               placeholder="Enter breed" >
+               placeholder="Enter breed"
+               disabled>
     </div>
 
@@ -125,5 +163,6 @@
                name="imageUrl"
                class="form-control"
-               placeholder="Enter image URL">
+               placeholder="Enter image URL"
+               disabled>
         <!-- <label for="upload">Image:</label>
         <input id="upload" type="file" accept="image/*">
@@ -137,5 +176,6 @@
                name="canBeFostered"
                class="form-control"
-               value=false>
+               value=false
+               disabled>
     </div>
 
