lundi 17 mai 2021

how to pass username and password from page to another using javascript

please i want to know how to store the user input data in the registeration page then i pass it to login page and in login page i validate if the user write the right username and password or not(that already passed from registeration page) here is my js code for registeration page:

     <head>
         <script>
             //function to check if the passoword is matched
             function checkpass() {
                 if (document.getElementById('psw').value ==
                     document.getElementById('psw-confirm').value) {
                     document.getElementById('message').style.color = 'green';
                     document.getElementById('message').innerHTML = 'Matched Passowrds';
                 } else {
                     document.getElementById('message').style.color = 'red';
                     document.getElementById('message').innerHTML = 'Those passwords didn’t match. Try again.';
                 }
             }
             //function to disable the submit button if the password is not matched
             function check_pass() {
                 if (document.getElementById('psw').value ==
                     document.getElementById('psw-confirm').value) {
                     document.getElementById('submit').disabled = false;
                 } else {
                     document.getElementById('submit').disabled = true;
                 }
             }
             //function of cancel button
             function goBack() {
                 window.history.back();
             }
             //function to only choose one gendre
             function onlyOne(checkbox) {
                 var checkboxes = document.getElementsByName('check')
                 checkboxes.forEach((item) => {
                     if (item !== checkbox) item.checked = false
                 })
             }
    
         </script>
         <link href="RegisterartinStyle.css" rel="stylesheet">
     </head>
    



Aucun commentaire:

Enregistrer un commentaire