Created
September 26, 2018 10:50
-
-
Save jtay/15480b32ef1c3220f5346a16e5773593 to your computer and use it in GitHub Desktop.
Validating Student Discount
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$("button.btn").click(function(){ | |
var NUS_Card_Number = $("#NUS_Card_Number").val(); | |
var systemIntegratorId = '9000049';//Math.floor((Math.random() * 100000000) + 1); | |
if(NUS_Card_Number == "") | |
{ | |
alert("NUS Card Number is required."); | |
return false; | |
} | |
else{ | |
//alert('hello'); | |
// var get_eight_char = NUS_Card_Number.substr(0, 8); | |
var check_number = NUS_Card_Number.startsWith("98261360"); | |
if(check_number != false) | |
{ | |
//$('#demo').html('<p>Valid Card Number.</p>'); | |
window.location.href="/collections/student-discount"; | |
} | |
else{ | |
$('#demo').html('<p style="color:red;">Invalid Card Number.</p>'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment