PHP submitting a form is destroying my sessions

Hello I am trying to make a form in the page where I created a session so when I submit the form the sessions gets destroyed here is my code: <form method="post"> <h5>Name</h5> <input type=text name="name" class="insertname"> <br> <br> <input type="submit" name="namesearch" class="insertbutton"></input> </form>’; PHP code to start the session : <?php if(isset($_POST[‘s’])) { $a=$_POST[‘uid’];… Read More PHP submitting a form is destroying my sessions

Form doesn't take me to action url when submitting

When I submit my form it doesn’t take me to the right url, it instead just stays on the same url and adds the params to it. Like this: /todo?message=themessage rather than what it should be as /todo/add <form> <div class="form-group" action="/todo/add" method="POST"> <label for="message">Add new todo message</label> <input type="text" class="form-control" name="message" id="message"> <button type="submit"… Read More Form doesn't take me to action url when submitting

Submit button not working with JS validation

const firstNameEl = document.querySelector(‘#firstName’); const lastNameEl = document.querySelector(‘#lastName’); const emailEl = document.querySelector(‘#email’); const telephoneEl = document.querySelector(‘#telephone’); const form = document.querySelector(‘#apply’); const checkFirstName = () => { let valid = false; const firstName = firstNameEl.value.trim(); if (!isRequired(firstName)) { showError(firstNameEl, ‘First name cannot be blank’); } else if (!isFirstNameValid(firstName)) { showError(firstNameEl, ‘First name must only contain letters’);… Read More Submit button not working with JS validation

Is it a good idea to use useRef to prevent rerendering on every input change?

I joined a Frontend bootcamp and now I have to create a registration form as a part of my first project. I want to use the best practices to be… you know… one of the best students to get hired afterwards. The registration form has 9 fields including selcet, textareas and usual inputs. And AFAIK… Read More Is it a good idea to use useRef to prevent rerendering on every input change?