Jump to content

Client login code does not work on mobile or tablet

Recommended Posts

Site URL: https://www.proexpoteam.com/

I have used code on a page to create a client login area for our clients to be able to access their exhibit assets and show information.  The login page works as it’s supposed to on the desktop and goes to the password page when you type the 5 letter login, but it gives me an error when you type the same login on mobile or tablet. 

 

I can type in the website and url slug (5 letter login) directly and it will go to the password page just fine on mobile or tablet. The code I used is below. 

 

Let me know if you have any ideas. 

 

 

<div id="submitCodeWrapper">

  <input id="event-code-input" type="text" maxlength="5" class="box" autofocus />

  <input id="event-code-submit" class="myButton"  type="submit" value="Submit" disabled="disabled">

  <div id="feedback"></div>

</div>

<script>

  var eventCode = document.getElementById("event-code-input");

  var codeSubmit = document.getElementById("event-code-submit");

  

  eventCode.addEventListener("keyup", function () {

    if (eventCode.value.length < 5) {

      feedback.style.color = "red";

      feedback.textContent = 'Code is not long enough yet...';

      codeSubmit.disabled = true;

      }

    else if (eventCode.value.length = 5) {

      feedback.style.color = "green";

      feedback.textContent = 'Code is correct length';

      codeSubmit.disabled = false;

      }

  });    

  codeSubmit.addEventListener("click", function () {   

    location.href = '/' + eventCode.value; return false;

});

</script>

<style>

.myButton {

  height:50px;

  margin-left:10px;

  width: 145px;

  padding: 4px;

  background-color: #ff6B00;

  color: #fff;

  border-radius: 50px;   

  border: 0;

  letter-spacing: 1px;

  color: #fff;

}  

#event-code-input {

  height:48px;

  font-size: 20px;

  padding-left:10px;

}

#feedback {

  margin-top: 10px;

  color:red;

}

</style>

 

Link to comment
  • Replies 2
  • Views 461
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.