Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
passphrase type page for a raffle

I was planning on using this password type style to let users check if they won. The codes are sent in an email then they come here to check if they won. If this was just for one winner the current system would work but i would like to add 5 and confirmPassword only allows one "code" to be valid. Is there anyway to add multiple valid ones?

<form>
    <label for="pswd">ENTER YOUR RAFFLE NUMBER HERE</label>
        <br>
    <input type="password" id="pswd" class="box" placeholder="test" onkeydown="if (event.keyCode == 13) {document.getElementById('btnSearch').click(); return false;}"/>
        <br>
    <input type="button" class="confirm" id="btnSearch" value="Check Results" onclick="checkPswd();" />
</form> 

</div>
    
<script type="text/javascript">
    function checkPswd() {
        var confirmPassword = "SampleCode";
        var password = document.getElementById("pswd").value;
        if (password == confirmPassword) {
             window.location="winner.html";
        }
        else{
            window.location="loser.html";
        }
    }
</script>
</body>
</html>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use array in Javascript:

const confirmPassword = ["SampleCode1", "SampleCode2", "SampleCode3","SampleCode4","SampleCode5"];
if(confirmPassword.includes(password)){
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!