How can I ensure that the passwords entered in a registration form match and how do I validate the entire form to be correct?
<form id="registerForm" method="POST" action="/register" class="form2">
<label>Email</label>
<input placeholder="Enter your email" type="text" name="email">
<label>Password</label>
<input placeholder="Enter password" type="password" id="password" name="password">
<label>Confirm Password</label>
<input placeholder="Confirm password" id="password-confirm" name="password-confirm" type="password">
<input type="hidden" name="regcapch" id="capchField" />
<input id="registerSubmit" style="background: #008DCC; color: white;" value="Register" type="submit" name=""/>
</form>
Can you provide guidance on writing code that compares the Password field with the Confirm Password field?