Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $("button").on("click", function(){
- username = $("#username").val();
- password = $("#password").val();
- //here shoule have come the code to recieve the data from python to stop sending the post request
- //
- return filled(username, password);
- });
- $.getJSON("/login", function(data){
- cosole.log("mm");
- });
- });
- function filled(username, password)
- {
- if(!username && ! password){
- $("#invalid1").show();
- $("#invalid2").show();
- return false;
- }
- else if(!password)
- {
- $("#invalid2").show();
- $("#invalid1").hide();
- return false;
- }
- else if (!username){
- $("#invalid1").show();
- $("#invalid2").hide();
- return false;
- }
- else
- {
- $("#invalid1").hide();
- $("#invalid2").hide();
- }
- }
Add Comment
Please, Sign In to add comment