Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function (){
- // Get the modal
- var modal = document.getElementById('myModal');
- // Get the button that opens the modal
- var btn = document.getElementById("Login");
- // Get the <span> element that closes the modal
- var span = document.getElementsByClassName("close")[0];
- var submitter = document.getElementsByClassName("Send");
- // When the user clicks the button, open the modal
- btn.onclick = function() {
- modal.style.display = "block";
- }
- submitter.onclick = function(){
- var x = document.getElementById("loginForm");
- var user = document.cmxForm[loginForm][username].value;
- var password = document.cmxForm[loginForm][password].value;
- // var user=x.elements[0].value();
- // var password=x.elements[1].value();
- // var user=$("#username").val();
- // var password=$("#password").val();
- // console.log(user);
- //console.log(password);
- if (verifyCookie(user, password) == true)
- {
- text="H";
- $('.header').html(/* El html del segundo ejercicio del primer set*/);
- // document.getElementById("loginForm").innerHTML = text;
- }
- else
- {
- text=" No test";
- setCookie(user, password);
- alert("The cookie was not found previously");
- modal.style.display="none";
- }
- }
- // When the user clicks on <span> (x), close the modal
- span.onclick = function() {
- modal.style.display = "none";
- }
- // When the user clicks anywhere outside of the modal, close it
- window.onclick = function(event) {
- if (event.target == modal) {
- modal.style.display = "none";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement